chiiya / laravel-code-style
Code style and quality configurations for Laravel projects
Fund package maintenance!
chiiya
Installs: 2 640
Dependents: 10
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 3
Requires
- php: ^8.2
- chiiya/code-style-php: ^3.0
- illuminate/contracts: ^11.0
- larastan/larastan: ^2.9
- phpro/grumphp: ^2.5
- spatie/laravel-package-tools: ^1.16
- tightenco/tlint: ^9.2
Requires (Dev)
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^9.0
- dev-master
- 3.0.0
- 2.3.0
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.0
- 1.9.0
- 1.8.2
- 1.8.1
- 1.8.0
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.0
- 1.1.0
- 1.0.0
- dev-dependabot/github_actions/stefanzweifel/git-auto-commit-action-5
- dev-dependabot/github_actions/actions/checkout-4
- dev-dependabot/github_actions/ramsey/composer-install-2
This package is auto-updated.
Last update: 2024-10-06 10:06:02 UTC
README
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