Download the PHP package bluehost/wp-php-standards without Composer
On this page you can find all versions of the php package bluehost/wp-php-standards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download bluehost/wp-php-standards
More information about bluehost/wp-php-standards
Files in bluehost/wp-php-standards
Package wp-php-standards
Short Description PHP Code Sniffer Standards for Bluehost WordPress projects.
License GPL-2.0-or-later
Informations about the package wp-php-standards
WordPress PHP Standards
PHP Code Sniffer Standards for Bluehost WordPress projects.
Installation
Add this Satis repository to your composer.json file:
Run composer require bluehost/wp-php-standards from your project root.
Usage
Run vendor/bin/phpcs . --standard=Bluehost from your project root to check your code.
Optionally, add a script to your composer.json file so you can just run composer run lint to check your code.
Additional Notes
- Append the
-sflag to see the internal names of the rules. - Add
--runtime-set testVersion 5.2-to check PHP version 5.2 or greater. - Add a custom
phpcs.xmlfile to your project to customize the ruleset or your desired configuration.
Additional Documentation
- https://github.com/squizlabs/PHP_CodeSniffer
- https://github.com/PHPCompatibility/PHPCompatibilityWP
- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
IDE Integration
Some IDE integrations of PHPCS will fail to register your ruleset since it doesn't live in your project root. In order to rectify this, place phpcs.xml at your project root:
PHPStorm Setup
- Open up the preferences panel.
- Go to "Languages & Frameworks" > "PHP" > "Code Sniffer".
- Ensure the "Configuration" section has "Local" set in the dropdown. Click the "..." button.
- Set the "PHP Code Sniffer path" to be "{projectRoot}/vendor/bin/phpcs" where "{projectRoot}" is the actual path of your project root.
- Hit "OK".
- Go to "Editor" > "Inspections" in the preference panel.
- Click on "PHP Code Sniffer validation" under the "PHP" > "Quality tools" section.
- Hit the refresh button next to the "Coding Standard" field on the right.
- Select "Bluehost" from the dropdown.
- Hit "OK" to exit the preferences panel.
All versions of wp-php-standards with dependencies
wp-coding-standards/wpcs Version @stable
phpcompatibility/phpcompatibility-wp Version @stable
dealerdirect/phpcodesniffer-composer-installer Version @stable