hypefactors / php-code-standards
PHP CS Fixer configuration for Hypefactors
Installs: 8 081
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Type:composer-plugin
Requires
- php: ^8.2
- composer-plugin-api: ^2.1
- larastan/larastan: ^2.9
- phpstan/phpstan: ^1.10
- phpstan/phpstan-mockery: ^1.1
- rector/rector: ^1.0
- symplify/easy-coding-standard: ^12.0
Requires (Dev)
- composer/composer: ^2.5
README
This repository contains the coding standards followed by Hypefactors.
It includes configuration for:
- Easy Coding Standard (
ecs
) - PHPStan (
phpstan
) - Rector (
rector
)
Setup
First install the dependency through Composer by running:
composer require hypefactors/php-code-standards --dev
Once the dependency is installed, run the following:
composer hypefactors:setup-code-standards
Next open your composer.json
file and add the following section:
"scripts": { "ecs:fix": "./vendor/bin/ecs --fix", "ecs:check": "./vendor/bin/ecs", "phpstan": "./vendor/bin/phpstan analyse --ansi", "rector:fix": "./vendor/bin/rector process --ansi", "rector:check": "./vendor/bin/rector process --ansi --dry-run" },
Note: If you already have a
scripts
section on yourcomposer.json
file, just merge the new scripts with the existing ones.
Usage
To use it, you can run one of the scripts added to your composer.json
file:
composer ecs:fix composer ecs:check composer phpstan composer rector:fix composer rector:check
License
PHP Code Standards is licenced under the BSD 3-Clause Licence. Please see the license file for more information.