magento-ecg / coding-standard

Magento PHP_CodeSniffer Coding Standard
MIT License
308 stars 100 forks source link

Uncaught TypeError: vsprintf(): Argument #2 ($values) must be of type array, string given in vendor/squizlabs/php_codesniffer/src/Files/File.php:1056 #67

Closed palakaccorin closed 2 years ago

palakaccorin commented 2 years ago

getting an error when using EcgM2 standard in phpcs in magento 2.4

Fatal error: Uncaught TypeError: vsprintf(): Argument #2 ($values) must be of type array, string given in /var/www/html/vendor/squizlabs/php_codesniffer/src/Files/File.php:1056 Stack trace:

0 /var/www/html/vendor/squizlabs/php_codesniffer/src/Files/File.php(1056): vsprintf('Unescaped outpu...', '<?= json_encode...')

1 /var/www/html/vendor/squizlabs/php_codesniffer/src/Files/File.php(672): PHP_CodeSniffer\Files\File->addMessage(true, 'Unescaped outpu...', 8, 29, 'Unescaped outpu...', '<?= json_encode...', 5, false)

2 /var/www/html/vendor/magento-ecg/coding-standard/EcgM2/Sniffs/Templates/EscapedOutputSniff.php(84): PHP_CodeSniffer\Files\File->addError('Unescaped outpu...', 47, 'Unescaped outpu...', '<?= json_encode...')

3 /var/www/html/vendor/squizlabs/php_codesniffer/src/Files/File.php(498): EcgM2\Sniffs\Templates\EscapedOutputSniff->process(Object(PHP_CodeSniffer\Files\LocalFile), 47)

4 /var/www/html/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php(92): PHP_CodeSniffer\Files\File->process()

5 /var/www/html/vendor/squizlabs/php_codesniffer/src/Runner.php(628): PHP_CodeSniffer\Files\LocalFile->process()

6 /var/www/html/vendor/squizlabs/php_codesniffer/src/Runner.php(434): PHP_CodeSniffer\Runner->processFile(Object(PHP_CodeSniffer\Files\LocalFile))

7 /var/www/html/vendor/squizlabs/php_codesniffer/src/Runner.php(114): PHP_CodeSniffer\Runner->run()

8 /var/www/html/vendor/squizlabs/php_codesniffer/bin/phpcs(18): PHP_CodeSniffer\Runner->runPHPCS()

9 /var/www/html/vendor/bin/phpcs(117): include('/var/www/html/v...')

10 {main}

thrown in /var/www/html/vendor/squizlabs/php_codesniffer/src/Files/File.php on line 1056

image

alexkaranda commented 2 years ago

https://github.com/magento-ecg/coding-standard/pull/68 - PR merged. Please upgrade to the latest version and re-test

palakaccorin commented 2 years ago

thanks @alexkaranda it works

alexkaranda commented 2 years ago

fix confirmed.