diff --git a/README.md b/README.md index 1a4c26b..efdd378 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,24 @@ We would like to extend our thanks to the following sponsors for funding Laravel - **[byte5](https://byte5.de)** - **[OP.GG](https://op.gg)** +## Code Style + +This project uses [Laravel Pint](https://laravel.com/docs/pint) for code styling. Pint is an opinionated PHP code style fixer for minimalists, built on top of PHP-CS-Fixer. + +To automatically fix code style issues, run: + +```bash +composer pint +``` + +To check for code style issues without fixing them: + +```bash +composer pint-test +``` + +The code style configuration can be found in `pint.json`. + ## Contributing Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). diff --git a/composer.json b/composer.json index 7d96925..5696bfe 100644 --- a/composer.json +++ b/composer.json @@ -52,6 +52,12 @@ "@php artisan key:generate --ansi", "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"", "@php artisan migrate --graceful --ansi" + ], + "pint": [ + "./vendor/bin/pint" + ], + "pint-test": [ + "./vendor/bin/pint --test" ] }, "extra": { diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..0640a65 --- /dev/null +++ b/pint.json @@ -0,0 +1,8 @@ +{ + "preset": "laravel", + "rules": { + "simplified_null_return": true, + "new_with_braces": true, + "no_unused_imports": true + } +}