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

ID: 16836
Updated by: gsherwood@squiz.net
Reported By: xxx at marynicolehicks dot com
Summary: Notice Raised
-Status: Open
+Status: Feedback
Type: Bug
Package: PHP_CodeSniffer
Operating System: Windows Vista 32
Package Version: 1.2.1
PHP Version: 5.2.5
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: squiz
Errors like this indicate that there is a bit of code PHPCS was unable
to tokenise correctly. I never mute errors like this because they mask a
bigger problem. To fix them, I need the code you were checking or some
sample code that produces the same issue. Are you able to supply some?


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

[2009-11-26 05:11:10] marynicolehicks

Description:
------------
NOTICE: Undefined index: scope_closer in D:\My Documents\My
Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php
on line 459

Test script:
---------------
Should be easy to spot in the code.

Expected result:
----------------
Expect no notices in logs.

Actual result:
--------------
2009-11-26T16:54:15+13:00 ERR (3): NOTICE: Undefined index:
scope_closer in D:\My Documents\My
Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php
on line 459
#0 D:\My Documents\My
Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php(459):
My_Log->LogErrorHandler(8, 'Undefined index...', 'D:\My Documents...',
459, Array)
#1 D:\My Documents\My
Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(772):
PHP_CodeSniffer_Tokenizers_PHP->processAdditional(Array, '??')
#2 D:\My Documents\My
Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(512):
PHP_CodeSniffer_File::tokenizeString('<?php????/**?? ...',
Object(PHP_CodeSniffer_Tokenizers_PHP), '??')
#3 D:\My Documents\My
Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(362):
PHP_CodeSniffer_File->_parse(NULL)
#4 D:\My Documents\My
Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(784):
PHP_CodeSniffer_File->start(NULL)
#5 D:\My Documents\My
Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(690):
PHP_CodeSniffer->processFile('D:\My Documents...')
#6 D:\My Documents\My
Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(341):
PHP_CodeSniffer->processFiles('D:\My Documents...', false)
#7 D:\My Documents\My
Websites\DreamHost\fms\test\CodeSniffer\RunCodeSniffer.php(20):
PHP_CodeSniffer->process(Array, 'D:\My Documents...')
#8 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(173):
include('D:\My Documents...')
#9 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(108):
UnitTests->runCodeSniffer()
#10 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(78):
UnitTests->__construct(Object(Zend_Console_Getopt))
#11 {main}

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

Search Discussions

  • Xxx at Nov 26, 2009 at 8:57 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16836&edit=1

    ID: 16836
    Comment by: xxx@marynicolehicks.com
    Reported By: xxx at marynicolehicks dot com
    Summary: Notice Raised
    Status: Feedback
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows Vista 32
    Package Version: 1.2.1
    PHP Version: 5.2.5
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    Yes this code here should cause it. I have taken out as much code as I
    can while still producing the same notice. Annoyingly I could not find
    where to attach files to comments, so I hope this still causes the
    problem after posting it. There was an opening PHP tag at the start but
    this comment box did not allow it. This is up there with some of my
    worst code, and now I have found it I could tidy up the code, but I
    still hope it helps fixing that notice.


    class ErrorController
    {
    public function errorAction()
    {
    $view = $this->view;

    $errorMessage = '';

    switch ($errorType) {
    // 404 error -- controller/action not found
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
    case '404';
    // check for a redirect
    if ($this->CheckForRedirect()){
    return;
    }

    // set the http response code to 404
    $this->getResponse()->setHttpResponseCode(404);

    // add the header and info message
    $fullUrl = $this->_helper->fullurl();
    $view->messages[] = '<b>404:</b> The page you requested
    ('.wordwrap(htmlentities( $fullUrl),75,'<br>',TRUE).') could not be
    found.';
    if (!empty($errorMessage)){
    $this->showAdminMessage($view,$errorMessage);
    }
    break;

    // application error; display error page, but don't change
    // status code
    default:
    // add the header and info message
    $view->messages[] = '<b>500:</b> The page you requested will be
    under maintenance until tomorrow.';
    if (isset($errorMessage)){
    My_Log::LogError( $errorMessage, My_Log::ERR );
    $this->showAdminMessage($view,$errorMessage);
    }
    break;
    }
    return $this->_forward('error','home');
    }
    }


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

    [2009-11-26 05:45:30] squiz

    -Status: Open
    +Status: Feedback
    -Assigned To:
    +Assigned To: squiz
    Errors like this indicate that there is a bit of code PHPCS was unable
    to tokenise correctly. I never mute errors like this because they mask a
    bigger problem. To fix them, I need the code you were checking or some
    sample code that produces the same issue. Are you able to supply some?

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

    [2009-11-26 05:11:10] marynicolehicks

    Description:
    ------------
    NOTICE: Undefined index: scope_closer in D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php
    on line 459

    Test script:
    ---------------
    Should be easy to spot in the code.

    Expected result:
    ----------------
    Expect no notices in logs.

    Actual result:
    --------------
    2009-11-26T16:54:15+13:00 ERR (3): NOTICE: Undefined index:
    scope_closer in D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php
    on line 459
    #0 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php(459):
    My_Log->LogErrorHandler(8, 'Undefined index...', 'D:\My Documents...',
    459, Array)
    #1 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(772):
    PHP_CodeSniffer_Tokenizers_PHP->processAdditional(Array, '??')
    #2 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(512):
    PHP_CodeSniffer_File::tokenizeString('<?php????/**?? ...',
    Object(PHP_CodeSniffer_Tokenizers_PHP), '??')
    #3 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(362):
    PHP_CodeSniffer_File->_parse(NULL)
    #4 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(784):
    PHP_CodeSniffer_File->start(NULL)
    #5 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(690):
    PHP_CodeSniffer->processFile('D:\My Documents...')
    #6 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(341):
    PHP_CodeSniffer->processFiles('D:\My Documents...', false)
    #7 D:\My Documents\My
    Websites\DreamHost\fms\test\CodeSniffer\RunCodeSniffer.php(20):
    PHP_CodeSniffer->process(Array, 'D:\My Documents...')
    #8 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(173):
    include('D:\My Documents...')
    #9 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(108):
    UnitTests->runCodeSniffer()
    #10 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(78):
    UnitTests->__construct(Object(Zend_Console_Getopt))
    #11 {main}

    ------------------------------------------------------------------------
  • Xxx at Nov 26, 2009 at 9:15 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16836&edit=1

    ID: 16836
    Comment by: xxx@marynicolehicks.com
    Reported By: xxx at marynicolehicks dot com
    Summary: Notice Raised
    Status: Feedback
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows Vista 32
    Package Version: 1.2.1
    PHP Version: 5.2.5
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    As a little side comment, I have not changed the NOTICE causing piece
    of code for many months and it seemed to work with version 1.2.0 fine
    but started causing the problem with 1.2.1


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

    [2009-11-26 09:57:38] marynicolehicks

    Yes this code here should cause it. I have taken out as much code as I
    can while still producing the same notice. Annoyingly I could not find
    where to attach files to comments, so I hope this still causes the
    problem after posting it. There was an opening PHP tag at the start but
    this comment box did not allow it. This is up there with some of my
    worst code, and now I have found it I could tidy up the code, but I
    still hope it helps fixing that notice.


    class ErrorController
    {
    public function errorAction()
    {
    $view = $this->view;

    $errorMessage = '';

    switch ($errorType) {
    // 404 error -- controller/action not found
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
    case '404';
    // check for a redirect
    if ($this->CheckForRedirect()){
    return;
    }

    // set the http response code to 404
    $this->getResponse()->setHttpResponseCode(404);

    // add the header and info message
    $fullUrl = $this->_helper->fullurl();
    $view->messages[] = '<b>404:</b> The page you requested
    ('.wordwrap(htmlentities( $fullUrl),75,'<br>',TRUE).') could not be
    found.';
    if (!empty($errorMessage)){
    $this->showAdminMessage($view,$errorMessage);
    }
    break;

    // application error; display error page, but don't change
    // status code
    default:
    // add the header and info message
    $view->messages[] = '<b>500:</b> The page you requested will be
    under maintenance until tomorrow.';
    if (isset($errorMessage)){
    My_Log::LogError( $errorMessage, My_Log::ERR );
    $this->showAdminMessage($view,$errorMessage);
    }
    break;
    }
    return $this->_forward('error','home');
    }
    }

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

    [2009-11-26 05:45:30] squiz

    -Status: Open
    +Status: Feedback
    -Assigned To:
    +Assigned To: squiz
    Errors like this indicate that there is a bit of code PHPCS was unable
    to tokenise correctly. I never mute errors like this because they mask a
    bigger problem. To fix them, I need the code you were checking or some
    sample code that produces the same issue. Are you able to supply some?

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

    [2009-11-26 05:11:10] marynicolehicks

    Description:
    ------------
    NOTICE: Undefined index: scope_closer in D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php
    on line 459

    Test script:
    ---------------
    Should be easy to spot in the code.

    Expected result:
    ----------------
    Expect no notices in logs.

    Actual result:
    --------------
    2009-11-26T16:54:15+13:00 ERR (3): NOTICE: Undefined index:
    scope_closer in D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php
    on line 459
    #0 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php(459):
    My_Log->LogErrorHandler(8, 'Undefined index...', 'D:\My Documents...',
    459, Array)
    #1 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(772):
    PHP_CodeSniffer_Tokenizers_PHP->processAdditional(Array, '??')
    #2 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(512):
    PHP_CodeSniffer_File::tokenizeString('<?php????/**?? ...',
    Object(PHP_CodeSniffer_Tokenizers_PHP), '??')
    #3 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(362):
    PHP_CodeSniffer_File->_parse(NULL)
    #4 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(784):
    PHP_CodeSniffer_File->start(NULL)
    #5 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(690):
    PHP_CodeSniffer->processFile('D:\My Documents...')
    #6 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(341):
    PHP_CodeSniffer->processFiles('D:\My Documents...', false)
    #7 D:\My Documents\My
    Websites\DreamHost\fms\test\CodeSniffer\RunCodeSniffer.php(20):
    PHP_CodeSniffer->process(Array, 'D:\My Documents...')
    #8 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(173):
    include('D:\My Documents...')
    #9 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(108):
    UnitTests->runCodeSniffer()
    #10 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(78):
    UnitTests->__construct(Object(Zend_Console_Getopt))
    #11 {main}

    ------------------------------------------------------------------------
  • Gsherwood at Nov 26, 2009 at 9:23 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16836&edit=1

    ID: 16836
    Updated by: gsherwood@squiz.net
    Reported By: xxx at marynicolehicks dot com
    Summary: Notice Raised
    -Status: Feedback
    +Status: Verified
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows Vista 32
    Package Version: 1.2.1
    PHP Version: 5.2.5
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    -Status: Feedback
    +Status: Verified
    Thanks a lot. Looks like the basic code causing the error is:

    switch ($errorType) {
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
    case '404';
    break;
    }


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

    [2009-11-26 10:14:57] marynicolehicks

    As a little side comment, I have not changed the NOTICE causing piece
    of code for many months and it seemed to work with version 1.2.0 fine
    but started causing the problem with 1.2.1

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

    [2009-11-26 09:57:38] marynicolehicks

    Yes this code here should cause it. I have taken out as much code as I
    can while still producing the same notice. Annoyingly I could not find
    where to attach files to comments, so I hope this still causes the
    problem after posting it. There was an opening PHP tag at the start but
    this comment box did not allow it. This is up there with some of my
    worst code, and now I have found it I could tidy up the code, but I
    still hope it helps fixing that notice.


    class ErrorController
    {
    public function errorAction()
    {
    $view = $this->view;

    $errorMessage = '';

    switch ($errorType) {
    // 404 error -- controller/action not found
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
    case '404';
    // check for a redirect
    if ($this->CheckForRedirect()){
    return;
    }

    // set the http response code to 404
    $this->getResponse()->setHttpResponseCode(404);

    // add the header and info message
    $fullUrl = $this->_helper->fullurl();
    $view->messages[] = '<b>404:</b> The page you requested
    ('.wordwrap(htmlentities( $fullUrl),75,'<br>',TRUE).') could not be
    found.';
    if (!empty($errorMessage)){
    $this->showAdminMessage($view,$errorMessage);
    }
    break;

    // application error; display error page, but don't change
    // status code
    default:
    // add the header and info message
    $view->messages[] = '<b>500:</b> The page you requested will be
    under maintenance until tomorrow.';
    if (isset($errorMessage)){
    My_Log::LogError( $errorMessage, My_Log::ERR );
    $this->showAdminMessage($view,$errorMessage);
    }
    break;
    }
    return $this->_forward('error','home');
    }
    }

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

    [2009-11-26 05:45:30] squiz

    -Status: Open
    +Status: Feedback
    -Assigned To:
    +Assigned To: squiz
    Errors like this indicate that there is a bit of code PHPCS was unable
    to tokenise correctly. I never mute errors like this because they mask a
    bigger problem. To fix them, I need the code you were checking or some
    sample code that produces the same issue. Are you able to supply some?

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

    [2009-11-26 05:11:10] marynicolehicks

    Description:
    ------------
    NOTICE: Undefined index: scope_closer in D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php
    on line 459

    Test script:
    ---------------
    Should be easy to spot in the code.

    Expected result:
    ----------------
    Expect no notices in logs.

    Actual result:
    --------------
    2009-11-26T16:54:15+13:00 ERR (3): NOTICE: Undefined index:
    scope_closer in D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php
    on line 459
    #0 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php(459):
    My_Log->LogErrorHandler(8, 'Undefined index...', 'D:\My Documents...',
    459, Array)
    #1 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(772):
    PHP_CodeSniffer_Tokenizers_PHP->processAdditional(Array, '??')
    #2 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(512):
    PHP_CodeSniffer_File::tokenizeString('<?php????/**?? ...',
    Object(PHP_CodeSniffer_Tokenizers_PHP), '??')
    #3 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(362):
    PHP_CodeSniffer_File->_parse(NULL)
    #4 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(784):
    PHP_CodeSniffer_File->start(NULL)
    #5 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(690):
    PHP_CodeSniffer->processFile('D:\My Documents...')
    #6 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(341):
    PHP_CodeSniffer->processFiles('D:\My Documents...', false)
    #7 D:\My Documents\My
    Websites\DreamHost\fms\test\CodeSniffer\RunCodeSniffer.php(20):
    PHP_CodeSniffer->process(Array, 'D:\My Documents...')
    #8 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(173):
    include('D:\My Documents...')
    #9 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(108):
    UnitTests->runCodeSniffer()
    #10 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(78):
    UnitTests->__construct(Object(Zend_Console_Getopt))
    #11 {main}

    ------------------------------------------------------------------------
  • Gsherwood at Nov 30, 2009 at 5:07 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16836&edit=1

    ID: 16836
    Updated by: gsherwood@squiz.net
    Reported By: xxx at marynicolehicks dot com
    Summary: Notice Raised
    Status: Verified
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows Vista 32
    Package Version: 1.2.1
    PHP Version: 5.2.5
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    This is caused by using a semi-colon to end the CASE statement instead
    of a colon. PHP_CodeSniffer would have never checked this code correctly
    although the error may not have been thrown because this is newish code
    to support more SWITCH structures.

    Please change the semi-colon to a colon to workaround this issue until
    it is fixed.


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

    [2009-11-26 10:22:46] squiz

    -Status: Feedback
    +Status: Verified
    Thanks a lot. Looks like the basic code causing the error is:

    switch ($errorType) {
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
    case '404';
    break;
    }

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

    [2009-11-26 10:14:57] marynicolehicks

    As a little side comment, I have not changed the NOTICE causing piece
    of code for many months and it seemed to work with version 1.2.0 fine
    but started causing the problem with 1.2.1

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

    [2009-11-26 09:57:38] marynicolehicks

    Yes this code here should cause it. I have taken out as much code as I
    can while still producing the same notice. Annoyingly I could not find
    where to attach files to comments, so I hope this still causes the
    problem after posting it. There was an opening PHP tag at the start but
    this comment box did not allow it. This is up there with some of my
    worst code, and now I have found it I could tidy up the code, but I
    still hope it helps fixing that notice.


    class ErrorController
    {
    public function errorAction()
    {
    $view = $this->view;

    $errorMessage = '';

    switch ($errorType) {
    // 404 error -- controller/action not found
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
    case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
    case '404';
    // check for a redirect
    if ($this->CheckForRedirect()){
    return;
    }

    // set the http response code to 404
    $this->getResponse()->setHttpResponseCode(404);

    // add the header and info message
    $fullUrl = $this->_helper->fullurl();
    $view->messages[] = '<b>404:</b> The page you requested
    ('.wordwrap(htmlentities( $fullUrl),75,'<br>',TRUE).') could not be
    found.';
    if (!empty($errorMessage)){
    $this->showAdminMessage($view,$errorMessage);
    }
    break;

    // application error; display error page, but don't change
    // status code
    default:
    // add the header and info message
    $view->messages[] = '<b>500:</b> The page you requested will be
    under maintenance until tomorrow.';
    if (isset($errorMessage)){
    My_Log::LogError( $errorMessage, My_Log::ERR );
    $this->showAdminMessage($view,$errorMessage);
    }
    break;
    }
    return $this->_forward('error','home');
    }
    }

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

    [2009-11-26 05:45:30] squiz

    -Status: Open
    +Status: Feedback
    -Assigned To:
    +Assigned To: squiz
    Errors like this indicate that there is a bit of code PHPCS was unable
    to tokenise correctly. I never mute errors like this because they mask a
    bigger problem. To fix them, I need the code you were checking or some
    sample code that produces the same issue. Are you able to supply some?

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

    [2009-11-26 05:11:10] marynicolehicks

    Description:
    ------------
    NOTICE: Undefined index: scope_closer in D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php
    on line 459

    Test script:
    ---------------
    Should be easy to spot in the code.

    Expected result:
    ----------------
    Expect no notices in logs.

    Actual result:
    --------------
    2009-11-26T16:54:15+13:00 ERR (3): NOTICE: Undefined index:
    scope_closer in D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php
    on line 459
    #0 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\Tokenizers\PHP.php(459):
    My_Log->LogErrorHandler(8, 'Undefined index...', 'D:\My Documents...',
    459, Array)
    #1 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(772):
    PHP_CodeSniffer_Tokenizers_PHP->processAdditional(Array, '??')
    #2 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(512):
    PHP_CodeSniffer_File::tokenizeString('<?php????/**?? ...',
    Object(PHP_CodeSniffer_Tokenizers_PHP), '??')
    #3 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer\File.php(362):
    PHP_CodeSniffer_File->_parse(NULL)
    #4 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(784):
    PHP_CodeSniffer_File->start(NULL)
    #5 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(690):
    PHP_CodeSniffer->processFile('D:\My Documents...')
    #6 D:\My Documents\My
    Websites\DreamHost\fms\library\Pear\pear\PHP\CodeSniffer.php(341):
    PHP_CodeSniffer->processFiles('D:\My Documents...', false)
    #7 D:\My Documents\My
    Websites\DreamHost\fms\test\CodeSniffer\RunCodeSniffer.php(20):
    PHP_CodeSniffer->process(Array, 'D:\My Documents...')
    #8 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(173):
    include('D:\My Documents...')
    #9 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(108):
    UnitTests->runCodeSniffer()
    #10 D:\My Documents\My Websites\DreamHost\fms\test\UnitTests.php(78):
    UnitTests->__construct(Object(Zend_Console_Getopt))
    #11 {main}

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedNov 26, '09 at 4:45a
activeNov 30, '09 at 5:07a
posts5
users2
websitepear.php.net

2 users in discussion

Gsherwood: 3 posts Xxx: 2 posts

People

Translate

site design / logo © 2022 Grokbase