For Programmers: Free Programming Magazines  


Home > Archive > PHP PEAR Questions and Answers > December 2007 > PHP_CodeSniffer (Christmas 2007 gift)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author PHP_CodeSniffer (Christmas 2007 gift)
Laurent Laville

2007-12-23, 7:03 pm

Hello all,

With stable release 1.0.0 of PHP_CodeSniffer, I've begun to play as a
little boy with a new toy.

Tired to have always the same errors

ERROR | End of line character is invalid; expected "\n" but found "\r\n"
ERROR | Constants must be uppercase; expected 'PHPUNIT_MAIN_METHOD' but
| found 'PHPUnit_MAIN_METHOD'
ERROR | Constants must be uppercase; expected PHPUNIT_MAIN_METHOD but
| found PHPUnit_MAIN_METHOD

when checking my packages source (on my Windows PC), I've build my own
PEAR standard with exceptions :

- when running on Windows platform check end line with "\r\n" rather
than "\n".
- when checking PHPUnit 3.x test suites accept mixed upper/lower case
for constants.

VERY VERY EASY (thanks Greg to make it possible with little effort) !

My contribution, if someone want to use it, is available for download at
[1].

To use it:
1. download content of ZIP file into a directory named A (A is what you
want)

2. run command
phpcs --standard=A\MyPEAR file_or_dir_to_check

Example:
phpcs -- standard=C:\php\CodeSniffer\Standards\My
PEAR
C:\php\pear\Services_W3C_CSSValidator\te
sts\AllTests.php

Happy Christmas
Laurent

[1] http://pear.laurent-laville.org/pep...yPEAR-0.1.0.zip
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com