dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] PHP code sniffer custom


From: Doursenaud , Raphaël
Subject: Re: [Dolibarr-dev] PHP code sniffer custom
Date: Tue, 9 Apr 2013 17:43:48 +0200

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 <address@hidden>
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) and projet module (task 772).

    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 HENRY
address@hidden
+33 6 03 76 48 07
http://www.open-concept.pro
Twitter : @_Open_Concept_

_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev




--
Raphaël Doursenaud
05 35 53 97 13 - 06 68 48 20 10
address@hidden

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]