2017 © Pedro Peláez
 

library yii-coding-standard

Yii Framework PHP CodeSniffer Coding Standard.

image

ardem/yii-coding-standard

Yii Framework PHP CodeSniffer Coding Standard.

  • Wednesday, August 7, 2013
  • by ardem
  • Repository
  • 11 Watchers
  • 38 Stars
  • 1,570 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 12 Forks
  • 5 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

Yii Framework PHP CodeSniffer Coding Standard (official repo)

You can read about Yii standard here: https://github.com/yiisoft/yii/wiki/Core-framework-code-style, (*1)

How to install

  1. Install PEAR:, (*2)

    http://pear.php.net/manual/en/installation.getting.php
  2. Install PHP_CodeSniffer:, (*3)

    pear install PHP_CodeSniffer
  3. 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
  4. If you want, you can set Yii as coding standard by default:, (*5)

    phpcs --config-set default_standard Yii

How to make a simple test

  1. Checking a file (if yii-coding-standard is your standard by default), (*6)

    phpcs path/to/file.php
  2. Checking a file (if yii-coding-standard is NOT your standard by default), (*7)

    phpcs --standard=Yii /path/to/file.php
  3. Checking a directory (if yii-coding-standard is your standard by default), (*8)

    phpcs /path/to/directory
  4. Checking a directory (if yii-coding-standard is NOT your standard by default), (*9)

    phpcs --standard=Yii /path/to/directory

How to use CS in IDE

  1. NetBeans:, (*10)

    http://plugins.netbeans.org/plugin/40282/phpmd-php-codesniffer-plugin
  2. PHPStorm, (*11)

    http://www.jetbrains.com/phpstorm/webhelp/using-php-code-sniffer-tool.html
  3. Zend Studio, (*12)

    http://files.zend.com/help/Zend-Studio/content/working_with_php_codesniffer.htm

How to make a standard coding in the team

Use pre-commit hooks, which will make a code standard check for every commit., (*13)

  1. For Git, (*14)

    http://git-scm.com/book/en/Customizing-Git-Git-Hooks
  2. For SVN, (*15)

    http://pear.php.net/manual/ru/package.php.php-codesniffer.svn-pre-commit.php

Yii-coding-standard and Composer

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"
            }
    }

The Versions

07/08 2013

dev-master

9999999-dev

Yii Framework PHP CodeSniffer Coding Standard.

  Sources   Download

BSD-3-Clause

The Requires

 

phpcs yii coding standards