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

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)    

 [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'; } }


 [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: de212ae75389e3