45press / phpcs
PHPCS base ruleset for 45PRESS
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:phpcodesniffer-standard
Requires
- php: >=7.1
- automattic/vipwpcs: 1.0.0
- dealerdirect/phpcodesniffer-composer-installer: ^0.5.0
- fig-r/psr2r-sniffer: ^0.5.0
- phpcompatibility/phpcompatibility-wp: ^2.0.0
- squizlabs/php_codesniffer: ~3.4.0
- wp-coding-standards/wpcs: 1.2.1
This package is auto-updated.
Last update: 2024-11-05 21:55:43 UTC
README
Installation
Install the library via Composer:
composer require --dev 45press/phpcs:dev-master
Usage
Lint your PHP files with the following command:
./vendor/bin/phpcs .
Edit the composer.json
file by adding the following:
"scripts": { "lint": [ "phpcs ." ], }
Then lint with...
composer run lint
Continuous Integration
Library loads the 45PRESS-Standard
ruleset, and checks for syntax errors for PHP 7.1 or higher.
To override the default PHP version check, set the --runtime-set testVersion 7.1-
configuration option. Example for PHP version 7.2 and above:
./vendor/bin/phpcs --runtime-set testVersion 7.2-
Note that you can only overrule PHP version check from the command-line.
IDE
IDE integrations of PHPCS can fail to register the 45PRESS-Standard
ruleset. If this happens, place .phpcs.xml.dist
at your project root:
<?xml version="1.0"?> <ruleset name="Project PHPCS"> <rule ref="45PRESS-Standard" /> </ruleset>