Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.0.0RC2

Bug #20261 phpcbf has an endless fixing loop
Submitted: 2014-05-01 19:46 UTC
From: phlopsi Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 2.0.0a2)
PHP Version: 5.5.8 OS: Windows 7
Roadmaps: (Not assigned)    

 [2014-05-01 19:46 UTC] phlopsi (Patrick Fischer)
Description: ------------ I ran the following command to beautify/fix AccessControl.php, also found on bitbucket ( C:\Users\Patrick\git\bitbucket\phlopsi\access-control\src\org\bitbucket\phlopsi\access_control>phpcbf.bat --standard=PSR2 -vvv AccessControl.php > report.txt patch: **** Only garbage was found in the patch input. sadly no fixes were applied and at the bottom of the report.txt i have found this: Reached maximum number of loops with 2 violations left unfixed i've uploaded the report here: i installed phpcbf through composer (composer global require "squizlabs/php_codesniffer=2.0.0a2")


 [2014-05-02 05:50 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Thanks for testing the phpcbf script for me. I've fixed this issue, which was caused by the PSR2 sniff incorrectly counting the newline character (/r/n in this case). The fix is here: c1b3b0e9af042 I also noticed that phpcbf wasn't fixing newline chars for you, so I added that in as well. So if you run it on that file now, it will fix all PSR2 errors that it finds.