FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19764&edit=1

ID: 19764
Updated by: gsherwood@squiz.net
Reported By: hinikato at mail dot ru
-Summary: Instead of for traits don't recognized right.
+Summary: Instead of for traits throws uppercase constant name
errors
Status: Open
Type: Bug
Package: PHP_CodeSniffer
Operating System: Windows 7
Package Version: SVN
PHP Version: 5.4.7
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:

-Summary: Instead of for traits don't recognized right.
+Summary: Instead of for traits throws uppercase
constant name errors
-Assigned To:
+Assigned To: squiz



Previous Comments:
------------------------------------------------------------------------

[2013-01-01 14:17:33] hinikato

Description:
------------
This use case don't recognized right. Also the PSR-2 don't contain
recommendations (descriptions) about use statements for traits, so the
following code must be right too:

use TProperties, TReflected; // it is a valid code

Test script:
---------------
<?php
namespace Myak\Base;

class Object implements IObject
{
use TProperties;
use TReflected {
TReflected::reflect insteadof TProperties;
}

public function __toString()
{
return $this->getHash();
}

public function getHash()
{
return spl_object_hash($this);
}
}

Expected result:
----------------
File is valid.

Actual result:
--------------
FILE: I:\project\myak\framework\src\lib\Myak\Base\Object.php
--------------------------------------------------------------------------------
FOUND 4 ERROR(S) AFFECTING 3 LINE(S)
--------------------------------------------------------------------------------
8 | ERROR | There must be one blank line after the last USE statement;
found;
9 | ERROR | Constants must be uppercase; expected REFLECT but found
reflect
9 | ERROR | Constants must be uppercase; expected TPROPERTIES but
found
TProperties
--------------------------------------------------------------------------------

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

Search Discussions

  • Gsherwood at Jan 6, 2013 at 10:54 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=19764&edit=1

    ID: 19764
    Updated by: gsherwood@squiz.net
    Reported By: hinikato at mail dot ru
    Summary: Instead of for traits throws uppercase constant name
    errors
    -Status: Assigned
    +Status: Closed
    Type: Bug
    Package: PHP_CodeSniffer
    Operating System: Windows 7
    Package Version: SVN
    PHP Version: 5.4.7
    Assigned To: squiz
    Roadmap Versions:
    New Comment:

    -Status: Assigned
    +Status: Closed
    Fix committed to github repo:
    https://github.com/squizlabs/PHP_CodeSniffer/commit/cc0c8bfdeb47c692485254635cc
    1ff1265660e7e


    Previous Comments:
    ------------------------------------------------------------------------

    [2013-01-06 22:51:53] squiz

    -Summary: Instead of for traits don&#039;t recognized right.
    +Summary: Instead of for traits throws uppercase
    constant name errors
    -Assigned To:
    +Assigned To: squiz


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

    [2013-01-01 14:17:33] hinikato

    Description:
    ------------
    This use case don't recognized right. Also the PSR-2 don't contain
    recommendations (descriptions) about use statements for traits, so the
    following code must be right too:

    use TProperties, TReflected; // it is a valid code

    Test script:
    ---------------
    <?php
    namespace Myak\Base;

    class Object implements IObject
    {
    use TProperties;
    use TReflected {
    TReflected::reflect insteadof TProperties;
    }

    public function __toString()
    {
    return $this->getHash();
    }

    public function getHash()
    {
    return spl_object_hash($this);
    }
    }

    Expected result:
    ----------------
    File is valid.

    Actual result:
    --------------
    FILE: I:\project\myak\framework\src\lib\Myak\Base\Object.php
    --------------------------------------------------------------------------------
    FOUND 4 ERROR(S) AFFECTING 3 LINE(S)
    --------------------------------------------------------------------------------
    8 | ERROR | There must be one blank line after the last USE statement;
    found;
    9 | ERROR | Constants must be uppercase; expected REFLECT but found
    reflect
    9 | ERROR | Constants must be uppercase; expected TPROPERTIES but
    found
    TProperties
    --------------------------------------------------------------------------------

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJan 6, '13 at 10:51p
activeJan 6, '13 at 10:54p
posts2
users1
websitepear.php.net

1 user in discussion

Gsherwood: 2 posts

People

Translate

site design / logo © 2022 Grokbase