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

Bug #19381 traits and indetations in traits are not handled properly
Submitted: 2012-04-12 18:45 UTC
From: taemtha Assigned: squiz
Status: Closed Package: PHP_CodeSniffer (version 1.3.3)
PHP Version: 5.4.0 OS: All
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 : 16 + 13 = ?

 
 [2012-04-12 18:45 UTC] taemtha (Michael Matzka)
Description: ------------ Using of traits and functions in traits generates not expected errors trait Timestampable { private $test; public function test() { $this->test = 'test'; } } if you let run codesniffer over this trait it shows up two errors: first is: <error line="..." column="..." source="Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase" severity="5">Constants must be uppercase; expected TIMESTAMPABLE but found Timestampable</error> - this should not be handled as Constant second is: <error line="..." column="..." source="Generic.WhiteSpace.ScopeIndent.Incorrect" severity="5">Line indented incorrectly; expected 0 spaces, found 4</error> - the indentation is handled wrong because traits are not handled the right way i guess Test script: --------------- trait Timestampable { private $test; public function test() { $this->test = 'test'; } }

Comments

 [2012-04-27 10:37 UTC] squiz (Greg Sherwood)
-Status: Open +Status: Closed -Assigned To: +Assigned To: squiz
Committed a fix to the git repo: https://github.com/squizlabs/PHP_CodeSniffer/commit/f6e857c4baa702493da80efb2c de212ae75389e3