PHP-CS-Fixer

PHP-Cs-Fixer is a tool fixes your code to follow standards; whether you want to follow PHP coding standards as defined in the PSR-1, PSR-2, etc., or other community driven ones like the Symfony one. You can also define your (team’s) style through configuration.

Phpactor can use PHP-CS-Fixer to:

  • format your code via the LSP textDocument/formatting action,

  • provide diagnostics for potential fixes,

  • provide source.fixAll.phpactor.phpCsFixer code action to allow auto-fixing on save.

To do so you set language_server_php_cs_fixer.enabled:

$ phpactor config:set language_server_php_cs_fixer.enabled true