Skip to content

anujith-singh/Symfony2-coding-standard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Symfony PHP CodeSniffer Coding Standard

A coding standard to check against the Symfony coding standards, originally shamelessly copied from the -disappeared- opensky/Symfony2-coding-standard repository.

Installation

Composer

This standard can be installed with the Composer dependency manager.

  1. Install Composer

  2. Install the coding standard as a dependency of your project

     composer require --dev anujithsingh/symfony2-coding-standard:1.0.0
    
  3. Check the installed coding standards for "Symfony"

     phpcs -i
    
  4. Done!

     bin/phpcs --standard=Symfony2 /path/to/code
    

Stand-alone

  1. Install PHP_CodeSniffer

  2. Checkout this repository

     git clone git://github.com/anujith-singh/Symfony2-coding-standard.git
    
  3. Move rules to squizlabs/PHP_CodeSniffer's Standards directory

     cp -R path/to/anujithsingh/symfony2-coding-standard/ vendor/squizlabs/php_codesniffer/src/Standards/Symfony2
    
  4. Check the installed coding standards for "Symfony"

     phpcs -i
    
  5. Done!

     phpcs --standard=Symfony2 /path/to/code
    

Contributing

If you do contribute code to these sniffs, please make sure it conforms to the PEAR coding standard and that the Symfony2-coding-standard unit tests still pass.

To check the coding standard, run from the Symfony2-coding-standard source root:

$ phpcs --ignore=*/tests/* --standard=PEAR . -n

The unit-tests are run from within the PHP_CodeSniffer directory:

$ phpunit --filter Symfony2_* tests/AllTests.php

About

github.com/opensky/Symfony2-coding-standard

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%