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: Feedback
+Status: No Feedback
Type: Feature/Change Request
Package: PHP_CodeSniffer
Operating System: Windows 7
Package Version: 1.4.3
PHP Version: 5.4.8
Assigned To: squiz
Roadmap Versions:
New Comment:

-Status: Feedback
+Status: No Feedback



Previous Comments:
------------------------------------------------------------------------

[2012-12-06 21:42:10] squiz

-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?

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

[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

  • Chowarmaan at Jan 9, 2013 at 3:47 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=19733&edit=1

    ID: 19733
    Updated by: chowarmaan@gmail.com
    Reported By: Chowarmaan at gmail dot com
    Summary: Add variables to main CodeSniffer options similar to
    classes, etc...
    -Status: No Feedback
    +Status: Closed
    Type: Feature/Change Request
    Package: PHP_CodeSniffer
    Operating System: Windows 7
    Package Version: 1.4.3
    PHP Version: 5.4.8
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    -Status: No Feedback
    +Status: Closed
    That sniff does appear to cover what I am after. I can determine if the
    variable is private and then enforce a coding standard on it.


    Previous Comments:
    ------------------------------------------------------------------------

    [2013-01-09 03:39:05] squiz

    -Status: Feedback
    +Status: No Feedback


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

    [2012-12-06 21:42:10] squiz

    -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?

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

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

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJan 9, '13 at 3:39a
activeJan 9, '13 at 3:47p
posts2
users2
websitepear.php.net

2 users in discussion

Gsherwood: 1 post Chowarmaan: 1 post

People

Translate

site design / logo © 2022 Grokbase