laminas/laminas-coding-standard
Provides Laminas PHP coding standard rules and tooling to enforce consistent code style and quality across projects, integrating with CI to automate checks and help teams follow Laminas conventions.
Install the module via Composer by running:
$ composer require --dev laminas/laminas-coding-standard
Add Composer scripts into your composer.json:
"scripts": {
"cs-check": "phpcs",
"cs-fix": "phpcbf"
}
Create file phpcs.xml on base path of your repository with content:
<?xml version="1.0"?>
<ruleset name="Laminas Coding Standard">
<rule ref="./vendor/laminas/laminas-coding-standard/ruleset.xml"/>
<!-- Paths to check -->
<file>config</file>
<file>src</file>
<file>test</file>
</ruleset>
You can add or exclude some locations in that file. For a reference please see: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset
To run checks only:
$ composer cs-check
To automatically fix many CS issues:
$ composer cs-fix
How can I help you explore Laravel packages today?