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

Bug #19490 Zend protected property underscore and camel caps issue (in trait)
Submitted: 2012-07-01 01:47 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)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 26 + 44 = ?

 
 [2012-07-01 01:47 UTC] ookami (Maik Penz)
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

Comments

 [2012-07-01 01: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 11: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 15: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; }