Skip to content

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jun 21, 2017

Running phpcbf with the --sufffix argument caused a fatal array to string conversion error.

The suffix argument is expected to be a string, but was being converted to an array with the explode in the Config::processLongArgument() method.

Fatal error: Uncaught exception 'PHP_CodeSniffer\Exceptions\RuntimeException' with message 'Array to string conversion in PHP_CodeSniffer\src\Reports\Cbf.php on line 81' in PHP_CodeSniffer\src\Runner.php on line 557 PHP_CodeSniffer\Exceptions\RuntimeException: Array to string conversion in PHP_CodeSniffer\src\Reports\Cbf.php on line 81 in PHP_CodeSniffer\src\Runner.php on line 557 Call Stack: 0.0000 124152 1. {main}() PHP_CodeSniffer\bin\phpcbf:0 0.0070 298216 2. PHP_CodeSniffer\Runner->runPHPCBF() PHP_CodeSniffer\bin\phpcbf:18 1.6141 6325976 3. PHP_CodeSniffer\Runner->run() PHP_CodeSniffer\src\Runner.php:193 1.6831 6985456 4. PHP_CodeSniffer\Runner->processFile() PHP_CodeSniffer\src\Runner.php:397 2.0111 7070176 5. PHP_CodeSniffer\Reporter->cacheFileReport() PHP_CodeSniffer\src\Runner.php:606 2.0111 7089040 6. PHP_CodeSniffer\Reports\Cbf->generateFileReport() PHP_CodeSniffer\src\Reporter.php:262 2.5131 7094152 7. PHP_CodeSniffer\Runner->handleErrors() PHP_CodeSniffer\src\Reporter.php:81 
Running `phpcbf` with the `--sufffix` argument caused a fatal `array to string conversion` error.
@gsherwood gsherwood added this to the 3.0.2 milestone Jun 23, 2017
@gsherwood gsherwood changed the title [3.x] Fix fatal error when using the --suffix argument Fatal error when using the --suffix argument Jun 23, 2017
@gsherwood
Copy link
Member

Thanks for finding and fixing that.

@gsherwood gsherwood merged commit d261986 into squizlabs:master Jun 23, 2017
gsherwood added a commit that referenced this pull request Jun 23, 2017
@jrfnl jrfnl deleted the feature/fix-suffix-cl-arg-fatal-error branch June 23, 2017 05:06
@jrfnl
Copy link
Contributor Author

jrfnl commented Jun 23, 2017

You're welcome ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants