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

  ID: 20252
  Updated by: gsherwood@squiz.net
  Reported By: fike dot root@gmail.com
-Summary: Unitialized string offset
+Summary: Unitialized string offset when package name starts
                     with underscore
  Status: Open
  Type: Bug
  Package: PHP_CodeSniffer
  Operating System: lubuntu 13.10
  Package Version: 1.5.2
  PHP Version: 5.5.3
-Assigned To:
+Assigned To: squiz
  Roadmap Versions:
  New Comment:

-Summary: Unitialized string offset
+Summary: Unitialized string offset when package name
               starts with underscore
-Assigned To:
+Assigned To: squiz



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

[2014-04-24 21:06:00] etki

Description:
------------
Hi.
I constantly get following error while analyzing different files:

PHP Notice: Uninitialized string offset: 0 in
/home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Stan
dards/PEAR/Sniffs/Commenting/FileCommentSniff.php on line 606

I can confirm that it happens when @package tag starts with underscore,

however, i think i've encountered this in different scenarios. The
minimal
scenario that triggers error is pasted below.

Test script:
---------------
<?php
/**
  * @package _helpers
  */
class MigrationHelper
{
}

Actual result:
--------------
Backtrace:
PHP Notice: Uninitialized string offset: 0 in
/home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Stan
dards/PEAR/Sniffs/Commenting/FileCommentSniff.php on line 606
PHP Stack trace:
PHP 1. {main}()
/home/fike/.composer/vendor/squizlabs/php_codesniffer/scripts/phpcs:0
PHP 2. PHP_CodeSniffer_CLI->process()
/home/fike/.composer/vendor/squizlabs/php_codesniffer/scripts/phpcs:37
PHP 3. PHP_CodeSniffer->process()
/home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/CLI.
php:614
PHP 4. PHP_CodeSniffer->processFile()
/home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php:
488
PHP 5. PHP_CodeSniffer->_processFile()
/home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php:
1340
PHP 6. PHP_CodeSniffer_File->start()
/home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php:
1460
PHP 7. PEAR_Sniffs_Commenting_ClassCommentSniff->process()
/home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/File.
php:506
PHP 8. PEAR_Sniffs_Commenting_FileCommentSniff->processTags()
/home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Stan
dards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:200
PHP 9. call_user_func()
/home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Stan
dards/PEAR/Sniffs/Commenting/FileCommentSniff.php:461
PHP 10. PEAR_Sniffs_Commenting_FileCommentSniff-
processPackage()
/home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Stan
dards/PEAR/Sniffs/Commenting/FileCommentSniff.php:461

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

Search Discussions

  • Gsherwood at Apr 29, 2014 at 1:39 am
    Edit report at https://pear.php.net/bugs/bug.php?id=20252&edit=1

      ID: 20252
      Updated by: gsherwood@squiz.net
      Reported By: fike dot root@gmail.com
      Summary: Unitialized string offset when package name starts
                         with underscore
    -Status: Assigned
    +Status: Closed
      Type: Bug
      Package: PHP_CodeSniffer
      Operating System: lubuntu 13.10
      Package Version: 1.5.2
      PHP Version: 5.5.3
      Assigned To: squiz
      Roadmap Versions:
      New Comment:

    -Status: Assigned
    +Status: Closed
    Fixed in github repo:
    https://github.com/squizlabs/PHP_CodeSniffer/commit/82ae9ff7630b30ecf5958bcf894
    ddac0b5701ffa


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

    [2014-04-29 03:50:55] squiz

    -Summary: Unitialized string offset
    +Summary: Unitialized string offset when package name
                   starts with underscore
    -Assigned To:
    +Assigned To: squiz


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

    [2014-04-24 21:06:00] etki

    Description:
    ------------
    Hi.
    I constantly get following error while analyzing different files:

    PHP Notice: Uninitialized string offset: 0 in
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Stan
    dards/PEAR/Sniffs/Commenting/FileCommentSniff.php on line 606

    I can confirm that it happens when @package tag starts with underscore,

    however, i think i've encountered this in different scenarios. The
    minimal
    scenario that triggers error is pasted below.

    Test script:
    ---------------
    <?php
    /**
      * @package _helpers
      */
    class MigrationHelper
    {
    }

    Actual result:
    --------------
    Backtrace:
    PHP Notice: Uninitialized string offset: 0 in
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Stan
    dards/PEAR/Sniffs/Commenting/FileCommentSniff.php on line 606
    PHP Stack trace:
    PHP 1. {main}()
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/scripts/phpcs:0
    PHP 2. PHP_CodeSniffer_CLI->process()
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/scripts/phpcs:37
    PHP 3. PHP_CodeSniffer->process()
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/CLI.
    php:614
    PHP 4. PHP_CodeSniffer->processFile()
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php:
    488
    PHP 5. PHP_CodeSniffer->_processFile()
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php:
    1340
    PHP 6. PHP_CodeSniffer_File->start()
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer.php:
    1460
    PHP 7. PEAR_Sniffs_Commenting_ClassCommentSniff->process()
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/File.
    php:506
    PHP 8. PEAR_Sniffs_Commenting_FileCommentSniff->processTags()
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Stan
    dards/PEAR/Sniffs/Commenting/ClassCommentSniff.php:200
    PHP 9. call_user_func()
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Stan
    dards/PEAR/Sniffs/Commenting/FileCommentSniff.php:461
    PHP 10. PEAR_Sniffs_Commenting_FileCommentSniff-
    processPackage()
    /home/fike/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Stan
    dards/PEAR/Sniffs/Commenting/FileCommentSniff.php:461

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedApr 29, '14 at 1:37a
activeApr 29, '14 at 1:39a
posts2
users1
websitepear.php.net

1 user in discussion

Gsherwood: 2 posts

People

Translate

site design / logo © 2022 Grokbase