Skip to content

PEAR and Squiz FunctionComment sniffs throw errors for some invalid @param line formats #1091

@andykais

Description

@andykais
php ~/Build/php-codesniffer-2.6.1/phpcs.phar --extensions=php,php3,php4,php5,phtml,inc,lib,module,info --report=xml --standard=PSR2,Generic,Zend,Squiz,PSR1,MySource,PEAR --report-file=phpcs.xml drupal-8.1.x PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php on line 261 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php on line 262 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php on line 261 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php on line 262 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php on line 230 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php on line 231 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php on line 261 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php on line 262 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php on line 261 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php on line 262 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php on line 230 PHP Notice: Undefined offset: 1 in phar:///home/andrew/Build/codedx/dev/lift-project/bundle/target/scala-2.11/classes/bundled-tools/php-codesniffer-2.6.1/phpcs.phar/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php on line 231 

seems to be coming from a preg_match that doesnt check if it yields nothing

preg_match('/([^$&.]+)(?:((?:\.\.\.)?(?:\$|&)[^\s]+)(?:(\s+)(.*))?)?/', $tokens[($tag + 2)]['content'], $matches); $typeLen = strlen($matches[1]); $type = trim($matches[1]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions