netbeansnetbeans-8php-cs-fixer

Netbeans php-cs-fixer end up with error "Files that were not fixed due to errors reported during linting after fixing:"


I am using php-cs-fixer for code formatting in Netbeans 8.2. When I try to format one file, it shows the error

Files that were not fixed due to errors reported during linting after fixing:

I searched for the fix in many websites, but couldn't get this fixed. Is there any way to fix this? I tried with both php-cs-fixer 1 and php-cs-fixer 2.


Solution

  • The error message means that PHP CS Fixer loaded some files from drive, apply changes on them, and then realised that files are not valid anymore (invalid PHP syntax) after those changes, thus it decided to not save it. That's one of the safety mechanism of PHP CS Fixer to not break your project.

    This means that you have found an issue in PHP CS Fixer itself. Please, verify you are using newest release, maybe the bug was already fixed!

    If not, please consider to expose your configuration file (if any) and content of files you got listed at https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/new !