Impossible to launch phpcbf, str_repeat IndentationSniff.php

Created on 10 January 2024, 6 months ago
Updated 31 May 2024, 28 days ago

Hi,

I'm installing quality-tools on my project dev env, and i have trouble with PHPCBF but PHPCS is working fine.

PHP 8.1
Drupal 10.1.6
drupal/coder:8.3.22

Used command to throw the error ./vendor/bin/phpcbf --colors --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml web/modules/custom web/themes/custom

When launching command this error appears

PHP Fatal error: Uncaught ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0 in /var/www/html/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/Indentation
Sniff.php:137
Stack trace:
#0 /var/www/html/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php(137): str_repeat()
#1 /var/www/html/vendor/squizlabs/php_codesniffer/src/Files/File.php(498): PHP_CodeSniffer\Standards\Squiz\Sniffs\CSS\IndentationSniff->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/Fixer.php(174): PHP_CodeSniffer\Files\LocalFile->process()
#4 /var/www/html/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php(52): PHP_CodeSniffer\Fixer->fixFile()
#5 /var/www/html/vendor/squizlabs/php_codesniffer/src/Reporter.php(285): PHP_CodeSniffer\Reports\Cbf->generateFileReport()
#6 /var/www/html/vendor/squizlabs/php_codesniffer/src/Runner.php(658): PHP_CodeSniffer\Reporter->cacheFileReport()
#7 /var/www/html/vendor/squizlabs/php_codesniffer/src/Runner.php(438): PHP_CodeSniffer\Runner->processFile()
#8 /var/www/html/vendor/squizlabs/php_codesniffer/src/Runner.php(204): PHP_CodeSniffer\Runner->run()
#9 /var/www/html/vendor/squizlabs/php_codesniffer/bin/phpcbf(18): PHP_CodeSniffer\Runner->runPHPCBF()
#10 /var/www/html/vendor/bin/phpcbf(119): include('...')
#11 {main}
thrown in /var/www/html/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/IndentationSniff.php on line 137

πŸ’¬ Support request
Status

Closed: outdated

Version

8.3

Component

Coder Sniffer

Created by

πŸ‡«πŸ‡·France erwandsn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024