FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19490&edit=1

ID: 19490
Updated by: gsherwood@squiz.net
Reported By: maik at phpkuh dot de
Summary: Zend protected property underscore and camel caps
issue (in trait)
-Status: Open
+Status: Wont fix
Type: Bug
Package: PHP_CodeSniffer
Operating System: Ubuntu 12.04
Package Version: 1.3.4
PHP Version: 5.4.4
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-Status: Open
+Status: Wont fix
-Assigned To:
+Assigned To: squiz
The Zend standard inside PHP_CodeSniffer *is not* the current Zend
Framework
coding standard. It is heavily out of date (by many many years) and
nobody has
ever contributed a new one. But people still use it, so I have to leave
it in there for
now.

I'm not sure if a Zend Framework coding standard exists, but it would be
worth
having a look around their documentation first.


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

[2012-06-30 21:50:12] ookami

-Summary: Zend protected property underscore and camel caps
issue
+Summary: Zend protected property underscore and camel caps
issue (in trait)
For a `trait` that is. For `class` it is working. Sorry!

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

[2012-06-30 21:47:41] ookami

Description:
------------
According to standards (
http://framework.zend.com/manual/en/coding-standard.naming-conventions.html
) a protected or private property must have a leading underscore. It is
not detected, but an (incorrect) error is generated for invalid
"camelCaps".

Test script:
---------------
<?php

class someClass
{
protected $_var = true;
}

Actual result:
--------------
5 | ERROR | Variable "_var" is not in valid camel caps format

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

Search Discussions

  • Maik at Jul 4, 2012 at 9:02 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19490&edit=1

    ID: 19490
    Updated by: maik@phpkuh.de
    Reported By: maik at phpkuh dot de
    Summary: Zend protected property underscore and camel caps
    issue (in trait)
    Status: Wont fix
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Ubuntu 12.04
    Package Version: 1.3.4
    PHP Version: 5.4.4
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    Sorry, confused both standards.

    If it is not maintained that is okay to.
    Just got confused with a sniff that works well with classes failing on a
    trait.

    Updated example:
    trait someTrait
    {
    protected $_var = false;
    }


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

    [2012-07-04 07:59:45] squiz

    -Status: Open
    +Status: Wont fix
    -Assigned To:
    +Assigned To: squiz
    The Zend standard inside PHP_CodeSniffer *is not* the current Zend
    Framework
    coding standard. It is heavily out of date (by many many years) and
    nobody has
    ever contributed a new one. But people still use it, so I have to leave
    it in there for
    now.

    I'm not sure if a Zend Framework coding standard exists, but it would be
    worth
    having a look around their documentation first.

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

    [2012-06-30 21:50:12] ookami

    -Summary: Zend protected property underscore and camel caps
    issue
    +Summary: Zend protected property underscore and camel caps
    issue (in trait)
    For a `trait` that is. For `class` it is working. Sorry!

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

    [2012-06-30 21:47:41] ookami

    Description:
    ------------
    According to standards (
    http://framework.zend.com/manual/en/coding-standard.naming-conventions.html
    ) a protected or private property must have a leading underscore. It is
    not detected, but an (incorrect) error is generated for invalid
    "camelCaps".

    Test script:
    ---------------
    <?php

    class someClass
    {
    protected $_var = true;
    }

    Actual result:
    --------------
    5 | ERROR | Variable "_var" is not in valid camel caps format

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 4, '12 at 5:53a
activeJul 4, '12 at 9:02a
posts2
users2
websitepear.php.net

2 users in discussion

Maik: 1 post Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase