-
Notifications
You must be signed in to change notification settings - Fork 42
Closed
Description
Bug Description
I get the following notice when using the PHPCS VIP Sniff. The issue seems to be file specific though:
Undefined offset: 42509 in /opt/composer/vendor/automattic/vipwpcs/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php on line 218
Trace:
File: \opt\composer\vendor\squizlabs\php_codesniffer\src\Runner.php on line 606
Trace:
#0 /opt/composer/vendor/automattic/vipwpcs/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php (218): PHP_CodeSniffer\Runner->handleErrors( $code = 8888888, $message = Undefined offset: 42509, $file = /opt/composer/vendor/automattic/vipwpcs/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php, $line = 218, Array( [i] => 1 ) )
#1 /opt/composer/vendor/automattic/vipwpcs/WordPressVIPMinimum/Sniffs/Functions/DynamicCallsSniff.php (86): WordPressVIPMinimum\Sniffs\Functions\DynamicCallsSniff->find_dynamic_calls()
#2 /opt/composer/vendor/wp-coding-standards/wpcs/WordPress/Sniff.php (910): WordPressVIPMinimum\Sniffs\Functions\DynamicCallsSniff->process_token( $stackPtr = 42508 )
#3 /opt/composer/vendor/squizlabs/php_codesniffer/src/Files/File.php (496): WordPressCS\WordPress\Sniff->process( $phpcsFile = PHP_CodeSniffer\Files\LocalFile Object, $stackPtr = 42508 )
#4 /opt/composer/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php (91): PHP_CodeSniffer\Files\File->process()
#5 /opt/composer/vendor/squizlabs/php_codesniffer/src/Fixer.php (174): PHP_CodeSniffer\Files\LocalFile->process()
#6 /opt/composer/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php (49): PHP_CodeSniffer\Fixer->fixFile()
#7 /opt/composer/vendor/squizlabs/php_codesniffer/src/Reporter.php (285): PHP_CodeSniffer\Reports\Cbf->generateFileReport( $report =
Array(
[filename] => /my-path/my-file.php
[errors] => 843
[warnings] => 205
[fixable] => 816
[messages] => Array(
[1] => Array(
[1] => Array(
[0] => Array(... TRUNCATED
, $phpcsFile = PHP_CodeSniffer\Files\LocalFile ObjectPHP_CodeSniffer\Files\LocalFile ObjectPHP_CodeSniffer\Files\LocalFile ObjectPHP_CodeSniffer\Files\LocalFile ObjectPHP_CodeSniffer\Files\LocalFile Object, $showSources = false, $width = 0 )
#8 /opt/composer/vendor/squizlabs/php_codesniffer/src/Runner.php (656): PHP_CodeSniffer\Reporter->cacheFileReport( $phpcsFile = PHP_CodeSniffer\Files\LocalFile Object, PHP_CodeSniffer\Config Object )
#9 /opt/composer/vendor/squizlabs/php_codesniffer/src/Runner.php (434): PHP_CodeSniffer\Runner->processFile( $file = PHP_CodeSniffer\Files\LocalFile Object )
#10 /opt/composer/vendor/squizlabs/php_codesniffer/src/Runner.php (200): PHP_CodeSniffer\Runner->run()
#11 /opt/composer/vendor/squizlabs/php_codesniffer/bin/phpcbf (18): PHP_CodeSniffer\Runner->runPHPCBF()
Minimal Code Snippet
Can you see if you can check it with the above trace? As this was a development file and we don't have that version anymore.
Environment
Use php -v
and composer show
to get versions.
Question | Answer |
---|---|
PHP version | PHP 7.4.11 |
PHP_CodeSniffer version | 3.5.6 |
VIPCS version | 2.2.0 |