FAQ
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.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 6, '12 at 9:42p
activeDec 6, '12 at 9:42p
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase