vaclavvanik / coding-standard
The Václav Vaník Coding Standard is a set of PHPCS rules applied to my projects ;-)
Package info
github.com/vaclavvanik/coding-standard
Type:phpcodesniffer-standard
pkg:composer/vaclavvanik/coding-standard
Requires
- php: ^7.3 || ^8.0
- dealerdirect/phpcodesniffer-composer-installer: ^0.6.2 || ^0.7
- slevomat/coding-standard: ^7.0.0
- squizlabs/php_codesniffer: ^3.6.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The Václav Vaník Coding Standard VVCS is a set of PHP_CodeSniffer
rules applied to my projects.
VVCS is inspired by Doctrine Coding Standard and heavily based on Slevomat Coding Standard.
Requirements
- PHP
^7.3 || ^8.0 - Composer
Installation
The recommended way to install VVCS is to use Composer
in a dedicated composer.json file in your project, for example in the
tools/php-coding-standard directory:
mkdir --parents tools/php-coding-standard composer require --working-dir=tools/php-coding-standard vaclavvanik/coding-standard cp tools/php-coding-standard/vendor/vaclavvanik/coding-standard/phpcs.dist.xml tools/php-coding-standard/.phpcs.xml cp tools/php-coding-standard/vendor/vaclavvanik/coding-standard/.gitignore tools/php-coding-standard/.gitignore
Configuration
Dist configuration file: phpcs.dist.xml. It is meant to be
placed in tools/php-coding-standard/.phpcs.xml and checks ../../src and
../../test by default - adjust the <file> paths to match your project layout.
To enable or disable individual rules, edit .phpcs.xml - see the commented-out
examples in phpcs.dist.xml.
Usage
Fix:
./tools/php-coding-standard/vendor/bin/phpcbf --standard=tools/php-coding-standard/.phpcs.xml
Check:
./tools/php-coding-standard/vendor/bin/phpcs --standard=tools/php-coding-standard/.phpcs.xml