FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17420&edit=1

ID: 17420
Updated by: gsherwood@squiz.net
Reported By: andreazzini at gmail dot com
Summary: Uncaught exception
Status: Open
Type: Bug
Package: PHP_CodeSniffer
Operating System: Debian Lenny (testing) x64
Package Version: 1.2.2
PHP Version: 5.3.2
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-Assigned To:
+Assigned To: squiz
First, thank you for supplying code. It is almost impossible to debug
issues like this
without code.

Second, the issue is caused by the comments you put between the
function
declaration and the opening function brace. PHPCS, when checking for a
brace,
stops looking after a couple of lines and assumes it wont find
anything. This is to
stop PHPCS looking through massive files for braces that may not be
there (like
inline blocks and abstract functions).

I'll try and get it to ignore the rule for comments, but moving them to
standard
phpdoc-style function comments will stop PHPCS from being confused as
well.


Previous Comments:
------------------------------------------------------------------------

[2010-05-20 18:01:32] endi

No way to attach a PHP file - a pretty bad limitation for the bug
tracking system IMHO.

You can download the file at
http://allievi.sssup.it/user/endi/JIncludes.php.txt

------------------------------------------------------------------------

[2010-05-20 17:55:23] endi

Description:
------------
PHP Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not
a class member var in
/usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
on line 51


I am attaching the file being tested, which is 237 lines x 8KB. It is
not a stand alone file, rather a Joomla! plugin, so you can test it with
phpcs but not run it directly.

Actual result:
--------------
PHP Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not
a class member var in
/usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
on line 51
#0
/usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php(51):
PHP_CodeSniffer_File->getMemberProperties(336)
#1
/usr/share/php/PHP/CodeSniffer/Standards/AbstractVariableSniff.php(154):
PEAR_Sniffs_NamingConventions_ValidVariableNameSniff->processMemberVar(Object(PHP_CodeSniffer_File),
336)
#2
/usr/share/php/PHP/CodeSniffer/Standards/AbstractScopeSniff.php(190):
PHP_CodeSniffer_Standards_AbstractVariableSniff->processTokenWithinScope(Object(PHP_CodeSniffer_File),
336, 40)
#3 /usr/share/php/PHP/CodeSniffer/File.php(431):
PHP_CodeSniffer_Standards_AbstractScopeSniff->process(Object(PHP_CodeSniffer_File),
336)
#4 /usr/share/php/PHP/CodeSniffer.php(900):
PHP_CodeSniffer_File->start(NULL)
#5 /usr/share/php/PHP/CodeSniffer.php(815):
PHP_CodeSniffer->_processFile('/home/andrea/tr...', NULL)
#6 in /usr/share/php/PHP/CodeSniffer/File.php on line 2047

------------------------------------------------------------------------

Search Discussions

  • Andreazzini at Jun 1, 2010 at 6:58 am
    Edit report at http://pear.php.net/bugs/bug.php?id=17420&edit=1

    ID: 17420
    Updated by: andreazzini@gmail.com
    Reported By: andreazzini at gmail dot com
    Summary: Uncaught exception
    Status: Assigned
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Debian Lenny (testing) x64
    Package Version: 1.2.2
    PHP Version: 5.3.2
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    Thank you for replying.

    Yes, in the meantime i did some good old trial-and-error and isolated
    the problem in my code (and failed to report it here - sorry for that).
    PHPCS ran perfectly after I moved those blocks after the opening {.

    Anyway, the problem was kind of obscure, and the traceback was no good
    in solving anything, so I still wish PHPCS reported a little more
    explicit error descriptions... and possibly expected (arbitrarily long?)
    block comments mostly anywhere :)


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-06-01 05:11:36] squiz

    -Assigned To:
    +Assigned To: squiz
    First, thank you for supplying code. It is almost impossible to debug
    issues like this
    without code.

    Second, the issue is caused by the comments you put between the
    function
    declaration and the opening function brace. PHPCS, when checking for a
    brace,
    stops looking after a couple of lines and assumes it wont find
    anything. This is to
    stop PHPCS looking through massive files for braces that may not be
    there (like
    inline blocks and abstract functions).

    I'll try and get it to ignore the rule for comments, but moving them to
    standard
    phpdoc-style function comments will stop PHPCS from being confused as
    well.

    ------------------------------------------------------------------------

    [2010-05-20 18:01:32] endi

    No way to attach a PHP file - a pretty bad limitation for the bug
    tracking system IMHO.

    You can download the file at
    http://allievi.sssup.it/user/endi/JIncludes.php.txt

    ------------------------------------------------------------------------

    [2010-05-20 17:55:23] endi

    Description:
    ------------
    PHP Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not
    a class member var in
    /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
    on line 51


    I am attaching the file being tested, which is 237 lines x 8KB. It is
    not a stand alone file, rather a Joomla! plugin, so you can test it with
    phpcs but not run it directly.

    Actual result:
    --------------
    PHP Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not
    a class member var in
    /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
    on line 51
    #0
    /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php(51):
    PHP_CodeSniffer_File->getMemberProperties(336)
    #1
    /usr/share/php/PHP/CodeSniffer/Standards/AbstractVariableSniff.php(154):
    PEAR_Sniffs_NamingConventions_ValidVariableNameSniff->processMemberVar(Object(PHP_CodeSniffer_File),
    336)
    #2
    /usr/share/php/PHP/CodeSniffer/Standards/AbstractScopeSniff.php(190):
    PHP_CodeSniffer_Standards_AbstractVariableSniff->processTokenWithinScope(Object(PHP_CodeSniffer_File),
    336, 40)
    #3 /usr/share/php/PHP/CodeSniffer/File.php(431):
    PHP_CodeSniffer_Standards_AbstractScopeSniff->process(Object(PHP_CodeSniffer_File),
    336)
    #4 /usr/share/php/PHP/CodeSniffer.php(900):
    PHP_CodeSniffer_File->start(NULL)
    #5 /usr/share/php/PHP/CodeSniffer.php(815):
    PHP_CodeSniffer->_processFile('/home/andrea/tr...', NULL)
    #6 in /usr/share/php/PHP/CodeSniffer/File.php on line 2047

    ------------------------------------------------------------------------
  • Gsherwood at Jun 21, 2010 at 1:58 am
    Edit report at http://pear.php.net/bugs/bug.php?id=17420&edit=1

    ID: 17420
    Updated by: gsherwood@squiz.net
    Reported By: andreazzini at gmail dot com
    -Summary: Uncaught exception
    +Summary: Uncaught exception when comment before function brace
    Status: Assigned
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Debian Lenny (testing) x64
    Package Version: 1.2.2
    PHP Version: 5.3.2
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    -Summary: Uncaught exception
    +Summary: Uncaught exception when comment before function brace



    Previous Comments:
    ------------------------------------------------------------------------

    [2010-06-01 07:51:39] endi

    Thank you for replying.

    Yes, in the meantime i did some good old trial-and-error and isolated
    the problem in my code (and failed to report it here - sorry for that).
    PHPCS ran perfectly after I moved those blocks after the opening {.

    Anyway, the problem was kind of obscure, and the traceback was no good
    in solving anything, so I still wish PHPCS reported a little more
    explicit error descriptions... and possibly expected (arbitrarily long?)
    block comments mostly anywhere :)

    ------------------------------------------------------------------------

    [2010-06-01 05:11:36] squiz

    -Assigned To:
    +Assigned To: squiz
    First, thank you for supplying code. It is almost impossible to debug
    issues like this
    without code.

    Second, the issue is caused by the comments you put between the function

    declaration and the opening function brace. PHPCS, when checking for a
    brace,
    stops looking after a couple of lines and assumes it wont find anything.
    This is to
    stop PHPCS looking through massive files for braces that may not be
    there (like
    inline blocks and abstract functions).

    I'll try and get it to ignore the rule for comments, but moving them to
    standard
    phpdoc-style function comments will stop PHPCS from being confused as
    well.

    ------------------------------------------------------------------------

    [2010-05-20 18:01:32] endi

    No way to attach a PHP file - a pretty bad limitation for the bug
    tracking system IMHO.

    You can download the file at
    http://allievi.sssup.it/user/endi/JIncludes.php.txt

    ------------------------------------------------------------------------

    [2010-05-20 17:55:23] endi

    Description:
    ------------
    PHP Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not a
    class member var in
    /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
    on line 51


    I am attaching the file being tested, which is 237 lines x 8KB. It is
    not a stand alone file, rather a Joomla! plugin, so you can test it with
    phpcs but not run it directly.

    Actual result:
    --------------
    PHP Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not a
    class member var in
    /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
    on line 51
    #0
    /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php(51):
    PHP_CodeSniffer_File->getMemberProperties(336)
    #1
    /usr/share/php/PHP/CodeSniffer/Standards/AbstractVariableSniff.php(154):
    PEAR_Sniffs_NamingConventions_ValidVariableNameSniff->processMemberVar(Object(PHP_CodeSniffer_File),
    336)
    #2 /usr/share/php/PHP/CodeSniffer/Standards/AbstractScopeSniff.php(190):
    PHP_CodeSniffer_Standards_AbstractVariableSniff->processTokenWithinScope(Object(PHP_CodeSniffer_File),
    336, 40)
    #3 /usr/share/php/PHP/CodeSniffer/File.php(431):
    PHP_CodeSniffer_Standards_AbstractScopeSniff->process(Object(PHP_CodeSniffer_File),
    336)
    #4 /usr/share/php/PHP/CodeSniffer.php(900):
    PHP_CodeSniffer_File->start(NULL)
    #5 /usr/share/php/PHP/CodeSniffer.php(815):
    PHP_CodeSniffer->_processFile('/home/andrea/tr...', NULL)
    #6 in /usr/share/php/PHP/CodeSniffer/File.php on line 2047

    ------------------------------------------------------------------------
  • Gsherwood at Jun 21, 2010 at 2:00 am
    Edit report at http://pear.php.net/bugs/bug.php?id=17420&edit=1

    ID: 17420
    Updated by: gsherwood@squiz.net
    Reported By: andreazzini at gmail dot com
    Summary: Uncaught exception when comment before function brace
    -Status: Assigned
    +Status: Closed
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Debian Lenny (testing) x64
    Package Version: 1.2.2
    PHP Version: 5.3.2
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    -Status: Assigned
    +Status: Closed
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.




    Previous Comments:
    ------------------------------------------------------------------------

    [2010-06-21 02:50:35] squiz

    -Summary: Uncaught exception
    +Summary: Uncaught exception when comment before function brace


    ------------------------------------------------------------------------

    [2010-06-01 07:51:39] endi

    Thank you for replying.

    Yes, in the meantime i did some good old trial-and-error and isolated
    the problem in my code (and failed to report it here - sorry for that).
    PHPCS ran perfectly after I moved those blocks after the opening {.

    Anyway, the problem was kind of obscure, and the traceback was no good
    in solving anything, so I still wish PHPCS reported a little more
    explicit error descriptions... and possibly expected (arbitrarily long?)
    block comments mostly anywhere :)

    ------------------------------------------------------------------------

    [2010-06-01 05:11:36] squiz

    -Assigned To:
    +Assigned To: squiz
    First, thank you for supplying code. It is almost impossible to debug
    issues like this
    without code.

    Second, the issue is caused by the comments you put between the function

    declaration and the opening function brace. PHPCS, when checking for a
    brace,
    stops looking after a couple of lines and assumes it wont find anything.
    This is to
    stop PHPCS looking through massive files for braces that may not be
    there (like
    inline blocks and abstract functions).

    I'll try and get it to ignore the rule for comments, but moving them to
    standard
    phpdoc-style function comments will stop PHPCS from being confused as
    well.

    ------------------------------------------------------------------------

    [2010-05-20 18:01:32] endi

    No way to attach a PHP file - a pretty bad limitation for the bug
    tracking system IMHO.

    You can download the file at
    http://allievi.sssup.it/user/endi/JIncludes.php.txt

    ------------------------------------------------------------------------

    [2010-05-20 17:55:23] endi

    Description:
    ------------
    PHP Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not a
    class member var in
    /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
    on line 51


    I am attaching the file being tested, which is 237 lines x 8KB. It is
    not a stand alone file, rather a Joomla! plugin, so you can test it with
    phpcs but not run it directly.

    Actual result:
    --------------
    PHP Fatal error: Uncaught PHP_CodeSniffer_Exception: $stackPtr is not a
    class member var in
    /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
    on line 51
    #0
    /usr/share/php/PHP/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php(51):
    PHP_CodeSniffer_File->getMemberProperties(336)
    #1
    /usr/share/php/PHP/CodeSniffer/Standards/AbstractVariableSniff.php(154):
    PEAR_Sniffs_NamingConventions_ValidVariableNameSniff->processMemberVar(Object(PHP_CodeSniffer_File),
    336)
    #2 /usr/share/php/PHP/CodeSniffer/Standards/AbstractScopeSniff.php(190):
    PHP_CodeSniffer_Standards_AbstractVariableSniff->processTokenWithinScope(Object(PHP_CodeSniffer_File),
    336, 40)
    #3 /usr/share/php/PHP/CodeSniffer/File.php(431):
    PHP_CodeSniffer_Standards_AbstractScopeSniff->process(Object(PHP_CodeSniffer_File),
    336)
    #4 /usr/share/php/PHP/CodeSniffer.php(900):
    PHP_CodeSniffer_File->start(NULL)
    #5 /usr/share/php/PHP/CodeSniffer.php(815):
    PHP_CodeSniffer->_processFile('/home/andrea/tr...', NULL)
    #6 in /usr/share/php/PHP/CodeSniffer/File.php on line 2047

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJun 1, '10 at 4:18a
activeJun 21, '10 at 2:00a
posts4
users2
websitepear.php.net

2 users in discussion

Gsherwood: 3 posts Andreazzini: 1 post

People

Translate

site design / logo © 2022 Grokbase