chiiya/laravel-code-style
Laravel Code Style
Code style configurations for Laravel projects using a combination of PHP-CS-Fixer, ECS and Rector.
index · installation · usage
Index
> Installation ..................................................................... > Usage ............................................................................
Installation
Install the package using composer. When prompted to create a GrumPHP configuration file, choose "No".
composer require chiiya/laravel-code-style --dev
Usage
# Publish config files
php artisan vendor:publish --tag="code-style-config"
Next, adjust the ecs.php, .php-cs-fixer.dist.php, rector.php and phpstan.neon files
that have just been created in your project folder to suit your project structure.
After publishing the configuration files, you may have to re-initialize GrumPHP:
php ./vendor/bin/grumphp git:deinit
php ./vendor/bin/grumphp git:init
The GrumPHP config includes tasks for PHP-CS-Fixer, ECS and TLint by default. Tasks for rector
and phpstan are not included, since they can take a long time. You may choose to execute them
separately instead (for example, in a CI pipeline), or add them to your GrumPHP config if you're
fine with the longer waiting times:
Example for grumphp.yml
grumphp:
tasks:
# ...
rector: ~
phpstan: ~
Example for a CI config (call these somewhere in your pipeline):
./vendor/bin/ecs check
./vendor/bin/php-cs-fixer fix --dry-run --diff
./vendor/bin/rector process --dry-run
./vendor/bin/tlint lint
./vendor/bin/phpstan analyse --memory-limit=2G
Related Packages
Admin user, role and permission management for Laravel Filament
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 4.1.1 | ^8.2 | ^12.0| | MIT | |
| 4.1.0 | ^8.2 | ^12.0| | MIT | |
| 4.0.0 | ^8.2 | ^12.0| | MIT | |
| 3.3.0 | ^8.2 | ^11.0| | MIT | |
| 3.2.0 | ^8.2 | ^11.0| | MIT | |
| 3.1.0 | ^8.2 | ^11.0 | MIT | |
| 3.0.0 | ^8.2 | ^11.0 | MIT | |
| 2.3.0 | ^8.2 | ^9.0| | MIT | |
| 2.2.3 | ^8.1 | ^9.0| | MIT | |
| 2.2.2 | ^8.1 | ^9.0| | MIT | |
| 2.2.1 | ^8.1 | ^9.0| | MIT | |
| 2.2.0 | ^8.1 | ^9.0| | MIT | |
| 2.1.0 | ^8.1 | ^9.0| | MIT | |
| 2.0.0 | ^8.1 | ^10.0 | MIT | |
| 1.9.0 | ^8.1 | ^10.0 | MIT | |
| 1.8.2 | ^8.1 | ^9.0 | MIT | |
| 1.8.1 | ^8.1 | ^9.0 | MIT | |
| 1.8.0 | ^8.1 | ^9.0 | MIT | |
| 1.7.1 | ^8.1 | ^9.0 | MIT | |
| 1.7.0 | ^8.1 | ^9.0 | MIT | |
| 1.6.0 | ^8.1 | ^9.0 | MIT | |
| 1.5.3 | ^8.1 | ^9.0 | MIT | |
| 1.5.2 | ^8.1 | ^9.0 | MIT | |
| 1.5.1 | ^8.1 | ^9.0 | MIT | |
| 1.5.0 | ^8.1 | ^9.0 | MIT | |
| 1.4.0 | ^8.1 | ^9.0 | MIT | |
| 1.3.0 | ^8.1 | ^9.0 | MIT | |
| 1.2.0 | ^8.1 | ^9.0 | MIT | |
| 1.1.0 | ^8.1 | ^9.0 | MIT | |
| 1.0.0 | ^8.1 | ^9.0 | MIT |