Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.2.0

Bug #19490 Zend protected property underscore and camel caps issue (in trait)
Submitted: 2012-06-30 20:47 UTC Modified: 2012-07-04 10:08 UTC
From: ookami Assigned: squiz
Status: Wont fix Package: PHP_CodeSniffer (version 1.3.4)
PHP Version: 5.4.4 OS: Ubuntu 12.04
Roadmaps: (Not assigned)    

 [2012-06-30 20:47 UTC] ookami (Maik Penz)
Description: ------------ According to standards ( ) 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


 [2012-06-30 20:50 UTC] ookami (Maik Penz)
-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-07-04 06:59 UTC] squiz (Greg Sherwood)
-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-07-04 10:08 UTC] ookami (Maik Penz)
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; }