dev-master
9999999-devYii Framework PHP CodeSniffer Coding Standard.
BSD-3-Clause
The Requires
phpcs yii coding standards
Yii Framework PHP CodeSniffer Coding Standard.
You can read about Yii standard here: https://github.com/yiisoft/yii/wiki/Core-framework-code-style, (*1)
Install PEAR:, (*2)
http://pear.php.net/manual/en/installation.getting.php
Install PHP_CodeSniffer:, (*3)
pear install PHP_CodeSniffer
Install Yii Coding Standard:, (*4)
git clone git://github.com/Ardem/yii-coding-standard.git Yii sudo ln -sv /path/to/yii-coding-standard/Yii $(pear config-get php_dir)/PHP/CodeSniffer/Standards
If you want, you can set Yii as coding standard by default:, (*5)
phpcs --config-set default_standard Yii
Checking a file (if yii-coding-standard is your standard by default), (*6)
phpcs path/to/file.php
Checking a file (if yii-coding-standard is NOT your standard by default), (*7)
phpcs --standard=Yii /path/to/file.php
Checking a directory (if yii-coding-standard is your standard by default), (*8)
phpcs /path/to/directory
Checking a directory (if yii-coding-standard is NOT your standard by default), (*9)
phpcs --standard=Yii /path/to/directory
NetBeans:, (*10)
http://plugins.netbeans.org/plugin/40282/phpmd-php-codesniffer-plugin
PHPStorm, (*11)
http://www.jetbrains.com/phpstorm/webhelp/using-php-code-sniffer-tool.html
Zend Studio, (*12)
http://files.zend.com/help/Zend-Studio/content/working_with_php_codesniffer.htm
Use pre-commit hooks, which will make a code standard check for every commit., (*13)
For Git, (*14)
http://git-scm.com/book/en/Customizing-Git-Git-Hooks
For SVN, (*15)
http://pear.php.net/manual/ru/package.php.php-codesniffer.svn-pre-commit.php
For using "yii-coding-standard" with Composer, include a dependency for "ardem/yii-coding-standard" in your composer.json file:, (*16)
{ "require": { "ardem/yii-coding-standard": "dev-master" } }
Yii Framework PHP CodeSniffer Coding Standard.
BSD-3-Clause
phpcs yii coding standards