Req #19733 [Opn->Fbk]: Add variables to main CodeSniffer options similar to classes, etc...

From: Date: Thu, 06 Dec 2012 21:42:10 +0000
Subject: Req #19733 [Opn->Fbk]: Add variables to main CodeSniffer options similar to classes, etc...
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-9391@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19733&edit=1 ID: 19733 Updated by: gsherwood@squiz.net Reported By: Chowarmaan at gmail dot com Summary: Add variables to main CodeSniffer options similar to classes, etc... -Status: Open +Status: Feedback Type: Feature/Change Request Package: PHP_CodeSniffer Operating System: Windows 7 Package Version: 1.4.3 PHP Version: 5.4.8 -Assigned To: +Assigned To: squiz Roadmap Versions: New Comment: -Status: Open +Status: Feedback -Assigned To: +Assigned To: squiz There is an abstract class that allows you to quickly located member vars, variables and variable inside strings. Member vars have a function that can be used to get properties about them, including their scope. And example of using this abstract class is this sniff: https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/Sq uiz/Sniffs/NamingConventions/ValidVariableNameSniff.php If this the kind of thing that you are after or are you looking for something more specific? Previous Comments: ------------------------------------------------------------------------ [2012-12-06 16:06:16] chowarmaan Description: ------------ Our company has different coding rules based on variable scope. It would be nice to be able to find all Public, Protected, Private, static even, variables, and then test the format of the variables to conform to a standard. On the start of parsing, the file would need to get all variables first, and their type. Obviously, variables within functions, etc... would cause problems. I am thinking the main class scope variables would be useful for the first pass. ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19733&edit=1

« previous php.pear.bugs (#9391) next »