ずっと5月

3日坊主してます

PHPCS-Fixerがコードを修正してくれない時

[vagrant@localhost phpmd]$ vendor/bin/php-cs-fixer fix cs-fixer.php --rules=@PSR2
Loaded config default.
Using cache file “.php_cs.cache”.

                                                                                 
  [Symfony\Component\Filesystem\Exception\IOException]                            
  Failed to write file “/home/vagrant/phpmd/cs-fixer.php”, “no reason available”.  
                                                                                 

fix [--path-mode PATH-MODE] [--allow-risky ALLOW-RISKY] [--config CONFIG] [--dry-run] [--rules RULES] [--using-cache USING-CACHE] [--cache-file CACHE-FILE] [--diff] [--format FORMAT] [--stop-on-violation] [--show-progress SHOW-PROGRESS] [--] [<path>]... 


結果的にPHPファイルへの書き込み権限がなかっただけだった。

$ sudo chmod ugo+w cs-fixer.php

これで解決