2017 © Pedro Peláez
 

library ctlt-coding-standard

CTLT PHP CodeSniffer Coding Standard

image

ubc/ctlt-coding-standard

CTLT PHP CodeSniffer Coding Standard

  • Tuesday, July 29, 2014
  • by compass
  • Repository
  • 26 Watchers
  • 1 Stars
  • 478 Installations
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

CTLT PHP CodeSniffer Coding Standard

A code standard based on Symfony 2 coding standards., (*1)

Installation (Composer)

  1. Install composer
  2. Add the dependency to composer.json:, (*2)

    {
        "require-dev": {
            "ubc/ctlt-coding-standard": "~1.0",
        }
    }
    
  3. Install dependencies, (*3)

    composer update, (*4)

  4. Use it, (*5)

    phpcs --standard=vendor/ubc/ctlt-coding-standard/ruleset.xml --runtime-set installed_paths vendor/m6web/symfony2-coding-standard src/*, (*6)

Or add the following Phing task:, (*7)

<target name="phpcs"
    description="Find coding standard violations using PHP_CodeSniffer and print human readable output. Intended for usage on the command line before committing.">
    <phpcodesniffer standard="${vendordir}/ubc/ctlt-coding-standard/ruleset.xml">
        <config name="installed_paths" value="${vendordir}/m6web/symfony2-coding-standard"/>
        <fileset dir="${sourcedir}">
            <include name="**/*.php" />
        </fileset>
    </phpcodesniffer>
</target>

Installation (Pear)

  1. Install phpcs:, (*8)

    pear install PHP_CodeSniffer
  2. Find your PEAR directory:, (*9)

    pear config-show | grep php_dir
  3. Copy, symlink or check out this repo and Symfony2 coding standard to the phpcs Standards directory:, (*10)

    cd /path/to/pear/PHP/CodeSniffer/Standards
    git clone git://github.com/opensky/Symfony2-coding-standard.git Symfony2
    git clone git://github.com/ubc/CTLT-PHP-coding-standard.git CTLT
  4. Set CTLT as your default coding standard:, (*11)

    phpcs --config-set default_standard CTLT
  5. ..., (*12)

  6. Profit!, (*13)

    cd /path/to/my/project
    phpcs
    phpcs path/to/my/file.php

The Versions

29/07 2014

dev-master

9999999-dev

CTLT PHP CodeSniffer Coding Standard

  Sources   Download

MIT

phpcs codesniffer symfony2 standard ctlt

29/07 2014

1.0

1.0.0.0

CTLT PHP CodeSniffer Coding Standard

  Sources   Download

MIT

phpcs codesniffer symfony2 standard ctlt