brainbits / phpcs-standard
Brainbits Coding Style
Installs: 38 421
Dependents: 14
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 2
Open Issues: 1
Type:phpcodesniffer-standard
Requires
Requires (Dev)
- phpunit/phpunit: ^10.5
README
Global
- Clone repository
- Install dependencies
composer install
- Configure standard:
{install-dir}/vendor/bin/phpcs --config-set default_standard BrainbitsCodingStandard
- Execute:
{install-dir}/vendor/bin/phpcs {src-dir}
In Project
- Add the standard to your project:
composer require brainbits/phpcs-standard
- Configure standard:
vendor/bin/phpcs --config-set default_standard BrainbitsCodingStandard
- Execute:
vendor/bin/phpcs {src-dir}
In Project with Ruleset Customization
- Add the standard to your project:
composer require brainbits/phpcs-standard
- Create phpcs.xml (See https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage)
- Include brainbits ruleset:
<rule ref="BrainbitsCodingStandard" />
- Add default src-dir:
<file>{src-dir}</file>
- Tweak to your needs, for example add rules or disable rules included in the brainbits standard.
- Include brainbits ruleset:
- Execute:
vendor/bin/phpcs
Docker
- docker run -it --rm -v $PWD:/app brainbits/phpcs-standard {src-dir}