Download the PHP package alex-the-coder/coding-standards without Composer
On this page you can find all versions of the php package alex-the-coder/coding-standards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alex-the-coder/coding-standards
More information about alex-the-coder/coding-standards
Files in alex-the-coder/coding-standards
Package coding-standards
Short Description Alex Coder's PHP Coding Standards
License BSD-3-Clause
Homepage https://alexcoder.ru/coding-standards
Informations about the package coding-standards
Alex Coders's coding standards
- README на русском
About
Alex Coders's PHP Coding Standards is a set of two PHP_CodeSniffer configuration XML files; the main ruleset.xml
config file that define base PHP coding standard, and a second ruleset-strict.xml
config file that define strict PHP coding standard.
Alex Coders's PHP Coding Standards is an essential development tool that ensures your code remains clean and consistent.
Requirements
Alex Coders's PHP Coding Standards requires PHP version 5.4.0 or greater and PHP_CodeSniffer version 3.6.0 or greater.
Installation
The easiest way to get started with Alex Coders's PHP Coding Standards is to install it through Composer with the following command:
Or alternatively, include a dependency for alex-the-coder/coding-standards
in your composer.json
file. For example:
You can then run PHP_CodeSniffer from the vendor's bin directory to make sure the necessary dependencies and all Alex Coder's PHP Coding Standards are installed correctly:
Getting Started
To check a PHP file against the Alex Coders's PHP Coding Standard, use the --standard
command line argument and specify the file's location:
Or if you wish to check an entire directory you can specify the directory location instead of a file:
If PHP_CodeSniffer finds any coding standard errors, a report will be shown after running the command.
Full usage information and example reports are available on the usage page.
Custom configuration file
To simplify usage, you can create an XML configuration file ./.phpcs.xml
in your project root with the content:
You can then run simple commands like:
or
See more information about using a Configuration File and Annotated Ruleset.
Full list of Customisable Sniff Properties here.
Documentation
The documentation for PHP_CodeSniffer is available on the Github wiki.
See the Configuration Options manual page.