Thursday, December 25, 2008

PHP Codesniffer standard for Symfony

I have created a standard for Symfony framework to use with PHP code sniffer.

-Download and install PHP code sniffer

-Check out the code from subversion

-Copy the Symfony directory to the code sniffer standard directory

-Put --standard=Symfony for validating the file using Symfony coding standards

$ phpcs --standard=Symfony /path/to/code/myfile.php


bicou said...

Hi, smfony coding guidelines indicate a indent level of 2 spaces, this is a patch :

Nico said...


I am thinking of using your code sniffer to sniff my Symfony code.

But I did noticed that in :
- ValidClassNameSniff.php
you are specifying :
- class and interface names start with a capital letter.

As far as Symfony doesnt verify this rule (a lot of Symfony classes start with the 'sf' prefix) :
- is your codesniffer in full accordance with Symfony ?

Thank you