rorymcdaniel / php-cs-fixer-config
PSR12 config for php-cs-fixer
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/rorymcdaniel/php-cs-fixer-config
This package is auto-updated.
Last update: 2025-10-28 22:26:29 UTC
README
This config file was created to match as closely as possible the PSR-12 standard since at present, php-cs-fixer does not yet have a preset for PSR-12.
Installation
composer require --dev rorymcdaniel/php-cs-config
CLI Usage
php-cs-fixer --config=vendor/rorymcdaniel/php-cs-fixer-config/.php_cs.php --verbose fix path/to/files
Creating a PHPStorm File Watcher
- Install PHP-CS-Fixer
brew install php-cs-fixer - Preferences -> Tools -> File Watchers
- Click the + at the bottom and choose Custom template
- Name:
php-cs-fixer(or whatever you like, this is just a label) - File Type: PHP
- Scope: Current File (this prevents it from changing files you are not working on)
- Program:
/usr/local/bin/php-cs-fixer - Arguments:
--config=$ProjectFileDir$/vendor/rorymcdaniel/php-cs-fixer-config/.php_cs.php --verbose fix $FileDir$/$FileName$ - Output paths to refresh:
$FileDir$/$FileName$ - Expand Working Directory and Environment Variables
- Working Directory:
$ProjectFileDir$ - Advanced options: only check
Trigger the watcher on external changes - Click OK to save
- Make sure the checkbox for
Enabledis checked PHP-CS-Fixer will now run on your code any time you save.