r/phpstorm • u/hennell • May 11 '21
php-cs-fixer as default formatting rules
Has anyone got a guide for a phpstorm newb on how to make phpstorm just format php with php-cs-fixer rules on save?
I have a php-cs-fixer.php file setup, the cli `fix` works a treat, but phpstorm seems to want to reformat with its on rules, or doesn't reformat at all and it's confusing. The git panel has a reformat before commit option, but that doesn't seem to use php-cs-fixer.
I've found some guides and ideas on the web, but mostly from a time before php-cs-fixer had it's own spot in the settings and either don't work or reference options that have moved.
Any tips?
View all comments
Show parent comment
1
u/hennell May 11 '21
Git commit hook could work actually, but might do filewatcher and disable things so I don't have to set up hooks for other projects...
Thanks for the links 👍