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

}

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedApr 27, '12 at 4:33a
activeApr 27, '12 at 4:33a
posts1
users1
websitepear.php.net

1 user in discussion

Gsherwood: 1 post

People

Translate

site design / logo © 2022 Grokbase