Hi Florian, It would be very cool to have a dedicated sniffer for Dolibarr ! I'm currently using one based on the PSRs with a modified indentation rule. (PSR says spaces, dolibarr uses tabs.)
I think you can get more information from the manual : https://pear.php.net/manual/tr/package.php.php-codesniffer.coding-standard-tutorial.php and from a quick search, it looks like there's already an example at https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php This may help you do what you're looking for. Don't hesitate te ping me if you need a hand ;) Cheers, 2013/4/9 Florian Henry <[email protected]> > Hello all, > > As de devcamp coming soon, I start to review code quality with PHP Code > Sniffer (as describe into wiki optionnal tools pages). > > I'm actually reviwing the note/private/public code (task > 811<https://doliforge.org/tracker/?func=detail&aid=811&group_id=144>) > and projet module (task > 772<https://doliforge.org/tracker/?func=detail&aid=772&atid=247&group_id=144> > ). > > During this review I see some strange code like "and" instead of "&&" > into if test statement or for array "$array[code]" instead of > "$array['code']". The PHP Code Sniffer show it immediatly and it's easy to > correct. > > This mail is to know if somebody know how to personnalize a little > more the file dev/codesniffer/ruleset.xml to add a rule to say that $_POST > or $_GET have to be replace by GETPOST dolibarr function ? > > Kind regards > > -- > Florian [email protected]+33 6 03 76 48 > 07http://www.open-concept.pro > Twitter : @_Open_Concept_ > > > _______________________________________________ > Dolibarr-dev mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/dolibarr-dev > > -- *Raphaël Doursenaud* 05 35 53 97 13 - 06 68 48 20 10 [email protected] -- <http://gpcsolutions.fr> http://gpcsolutions.fr Technopole Hélioparc 2 avenue du Président Pierre Angot 64053 PAU CEDEX 9 SARL GPC.solutions au capital de 7 500 € - R.C.S. PAU 528 995 921
_______________________________________________ Dolibarr-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/dolibarr-dev
