Download the PHP package avengerscodelovers/laravel-cs without Composer
On this page you can find all versions of the php package avengerscodelovers/laravel-cs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download avengerscodelovers/laravel-cs
More information about avengerscodelovers/laravel-cs
Files in avengerscodelovers/laravel-cs
Package laravel-cs
Short Description Laravel coding standards config
License MIT
Informations about the package laravel-cs
Laravel CS
This project aims to provide a common coding standards, static analysis configuration for Laravel projects.
Purpose
The purpose of this project is to share a standardized PHP-CS-Fixer and PHPStan configuration that can be easily used across different Laravel projects. By using this configuration, you can ensure consistent code formatting, style, and static analysis throughout your codebase.
Install
To use this configuration, install this composer package:
Usage
Code conventions
You can use PHP-CS-Fixer to check code conventions, format code with --config
option:
To incorporate CI integration, you can utilize the following command to verify if the code adheres to the conventions:
By using this configuration, PHP-CS-Fixer will apply the defined rules to your codebase, ensuring that it adheres to the coding standards.
You can also add add the PHP-CS-Fixer command to the composer.json
scripts:
After adding the script, you can run the PHP-CS-Fixer command by executing the following command in your terminal:
Static analysis
To perform static analysis on your code and identify potential issues or errors, you can use PHPStan.
First, create a phpstan.neon
or phpstan.neon.dist
file in the root of your application. It might look like this:
Then you can run PHPStan with the following command:
You may add the PHPStan command to the composer.json
scripts:
After adding the script, you can run PHPStan by executing the following command in your terminal:
Usage with lint-staged
You can also integrate with lint-staged and pre-commit to automatically run the fixer, static analysis when committing changes:
All versions of laravel-cs with dependencies
phpstan/phpstan Version ^1.11
larastan/larastan Version ^2.9
phpstan/phpstan-strict-rules Version ^1.6