This repository provides configurations for friendsofphp/php-cs-fixer
, which can be used to verify and enforce a coding standard for PHP code within projects.
References from:
Run
composer require --dev betasavvy/phpcs-fixer-config
Add to composer.json (optional)
"scripts": {
"check": [
"@cs",
],
"cs": "php-cs-fixer fix -v --diff --dry-run",
"cs-fix": "php-cs-fixer fix -v --diff"
}
Create a configuration file .php_cs
in the root of your project.
<?php
$config = new BetaSavvy\Fixer\Config();
$config->getFinder()
// ->exclude(['fixture'])
->in([
__DIR__ . '/app',
__DIR__ . '/config',
__DIR__ . '/database',
__DIR__ . '/routes',
__DIR__ . '/tests',
]);
return $config;
Add .php_cs.cache
(file is created by php-cs-fixer
) to .gitignore
vendor/
.php_cs.cache
This package is licensed using the MIT License.