cursorstartups / php-styles
Cursor startups shared PHP style rules for PHP-CS-Fixer
Installs: 12 125
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 1
Requires
- friendsofphp/php-cs-fixer: ^3.0.0
README
About
PHP-CS-Fixer is an open-source tool that can enforce, and detect violations of, PHP coding styles. With predefined rules, it allows you to have a strict coding style.
This repo is intended for use on all Cursor Startups Project.
Installation
Require the package in your laravel or php project.
composer require cursorstartups/php-styles --dev
If you are working on a laravel project copy .php-cs-fixer.dist.php
to root directory
cp vendor/cursorstartups/php-styles/.laravel-php-cs-fixer.dist.php .php-cs-fixer.dist.php
Usage
To Fix code, run
./vendor/bin/php-cs-fixer fix
To make is easier, you can add a shortcut command on your composer.json
as follows
"scripts": "format": [ "./vendor/bin/php-cs-fixer fix" ], }
After that you can run the following from terminal
composer format
Note: The above command will create .php-cs-fixer.cache
. Remember to add this file to your .gitignore
Credit
- Amos Njogu for maintaining this project
- Laravel shift for open sourcing this amazing configuration laravel-shift/.php_cs.laravel.php