Bug #19381 [Opn->Csd]: traits and indetations in traits are not handled properly

From: Date: Fri, 27 Apr 2012 05:37:02 +0000
Subject: Bug #19381 [Opn->Csd]: traits and indetations in traits are not handled properly
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-8588@lists.php.net to get a copy of this message
Edit report at https://pear.php.net/bugs/bug.php?id=19381&edit=1 ID: 19381 Updated by: gsherwood@squiz.net Reported By: mmatzka at gmail dot com Summary: traits and indetations in traits are not handled properly -Status: Open +Status: Closed Type: Bug Package: PHP_CodeSniffer Operating System: All Package Version: 1.3.3 PHP Version: 5.4.0 -Assigned To: +Assigned To: squiz Roadmap Versions: New Comment: -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 Previous Comments: ------------------------------------------------------------------------ [2012-04-12 14:45:02] taemtha 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'; } } ------------------------------------------------------------------------ -- Edit this bug report at https://pear.php.net/bugs/bug.php?id=19381&edit=1

« previous php.pear.bugs (#8588) next »