Created
November 12, 2014 21:24
-
-
Save mpalourdio/46f792347cf9d46b121c to your computer and use it in GitHub Desktop.
@fabpot php-cs-fixer config for PhpStorm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters | |
--level=psr2 --verbose fix $FileDir$/$FileName$ | |
working directory | |
$ProjectFileDir$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Step by step:
composer global require friendsofphp/php-cs-fixer
paste this
export PATH="$PATH:$HOME/.composer/vendor/bin"
into your .zshrc or .bashrc or .profile depending on your system usually located at your HOME directoryLinux: .bashrc
Mac: .profile
Mac with Oh my zsh : .zshrc
Save this code as watcher.xml on your harddrive.
You can further edit the arguments aka add rules:
<option name="arguments" value="fix $FileDir$/$FileName$ --allow-risky=yes rules=@PSR2, @Symfony" />
Various rules can be found here : Rules By default the cs Fixer uses PSR2
Import it in phpstorm:

PHPstorm->preferences->tools->File Watchers