You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
run vendor/bin/phpcs -d memory_limit=2G --standard=Magento2 --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=report-phpcs.json --basepath=/var/www/html app/design/frontend/Phoenix/
Expected result
Normal report
Actual result
Fatal Error.
PHP Fatal error: Uncaught ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) in /var/www/html/vendor/magento/magento-coding-standard/Magento2/Sniffs/Less/ClassNamingSniff.php:69
Stack trace:
#0 /var/www/html/vendor/magento/magento-coding-standard/Magento2/Sniffs/Less/ClassNamingSniff.php(69): strpos()
#1 /var/www/html/vendor/squizlabs/php_codesniffer/src/Files/File.php(498): Magento2\Sniffs\Less\ClassNamingSniff->process()
#2 /var/www/html/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php(92): PHP_CodeSniffer\Files\File->process()
#3 /var/www/html/vendor/squizlabs/php_codesniffer/src/Runner.php(628): PHP_CodeSniffer\Files\LocalFile->process()
#4 /var/www/html/vendor/squizlabs/php_codesniffer/src/Runner.php(434): PHP_CodeSniffer\Runner->processFile()
#5 /var/www/html/vendor/squizlabs/php_codesniffer/src/Runner.php(114): PHP_CodeSniffer\Runner->run()
#6 /var/www/html/vendor/squizlabs/php_codesniffer/bin/phpcs(18): PHP_CodeSniffer\Runner->runPHPCS()
#7 {main}
thrown in /var/www/html/vendor/magento/magento-coding-standard/Magento2/Sniffs/Less/ClassNamingSniff.php on line 69
As you can see from less file, a class name is shorter than the expected offset 2.
A possible solution is to check the string length before checking the underscore in the className, or check if the found position is bigger than 2
The text was updated successfully, but these errors were encountered:
Preconditions
Example of less file
Steps to reproduce
vendor/bin/phpcs -d memory_limit=2G --standard=Magento2 --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=report-phpcs.json --basepath=/var/www/html app/design/frontend/Phoenix/
Expected result
Normal report
Actual result
Fatal Error.
As you can see from less file, a class name is shorter than the expected offset 2.
A possible solution is to check the string length before checking the underscore in the className, or check if the found position is bigger than 2
The text was updated successfully, but these errors were encountered: