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

  ID: 20029
  Comment by: [email protected]
  Reported By: [email protected]
  Summary: ForbiddenFunction sniff incorrectly recognizes
                     methods in "use" clauses
  Status: Open
  Type: Bug
  Package: PHP_CodeSniffer
  Operating System: Debian GNU/Linux 7 (wheezy)
  Package Version: 1.4.6
  PHP Version: Irrelevant
  Roadmap Versions:
  New Comment:

Working on a patch today.


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

[2013-08-05 20:10:38] luke_stoysnet

Description:
------------
ForbiddenFunction sniff recognizes method renames in use clause
as if they were functions.

Test script:
---------------
<?
trait DelProvider {
  public function delete() {
   //irrelevant
  }
}

class MethodIsNotFunctionTest {
  use DelProvider {
   delete as protected unsetter;
  }
}

Actual result:
--------------
The use of function delete() is forbidden; use unset() instead

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

Search Discussions

  • Luke at Aug 5, 2013 at 6:29 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=20029&edit=1

      ID: 20029
      Comment by: [email protected]
      Reported By: [email protected]
      Summary: ForbiddenFunction sniff incorrectly recognizes
                         methods in "use" clauses
      Status: Open
      Type: Bug
      Package: PHP_CodeSniffer
      Operating System: Debian GNU/Linux 7 (wheezy)
      Package Version: 1.4.6
      PHP Version: Irrelevant
      Roadmap Versions:
      New Comment:

    Fix delivered here:
    https://github.com/squizlabs/PHP_CodeSniffer/pull/143


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

    [2013-08-05 20:11:00] luke_stoysnet

    Working on a patch today.

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

    [2013-08-05 20:10:38] luke_stoysnet

    Description:
    ------------
    ForbiddenFunction sniff recognizes method renames in use clause
    as if they were functions.

    Test script:
    ---------------
    <?
    trait DelProvider {
      public function delete() {
       //irrelevant
      }
    }

    class MethodIsNotFunctionTest {
      use DelProvider {
       delete as protected unsetter;
      }
    }

    Actual result:
    --------------
    The use of function delete() is forbidden; use unset() instead

    ------------------------------------------------------------------------
  • Gsherwood at Aug 7, 2013 at 6:22 am
    Edit report at https://pear.php.net/bugs/bug.php?id=20029&edit=1

      ID: 20029
      Updated by: [email protected]
      Reported By: [email protected]
      Summary: ForbiddenFunction sniff incorrectly recognizes
                         methods in "use" clauses
    -Status: Open
    +Status: Closed
      Type: Bug
      Package: PHP_CodeSniffer
      Operating System: Debian GNU/Linux 7 (wheezy)
      Package Version: 1.4.6
      PHP Version: Irrelevant
    -Assigned To:
    +Assigned To: squiz
      Roadmap Versions:
      New Comment:

    -Status: Open
    +Status: Closed
    -Assigned To:
    +Assigned To: squiz
    Fixed in github repo:
    https://github.com/squizlabs/PHP_CodeSniffer/commit/7c7493bac94e170dbc80c4a4f4
    6bdef9fd3b7dc6

    Can discuss anything else on the PR.


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

    [2013-08-05 20:34:42] luke_stoysnet

    Fix delivered here:
    https://github.com/squizlabs/PHP_CodeSniffer/pull/143

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

    [2013-08-05 20:11:00] luke_stoysnet

    Working on a patch today.

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

    [2013-08-05 20:10:38] luke_stoysnet

    Description:
    ------------
    ForbiddenFunction sniff recognizes method renames in use clause
    as if they were functions.

    Test script:
    ---------------
    <?
    trait DelProvider {
      public function delete() {
       //irrelevant
      }
    }

    class MethodIsNotFunctionTest {
      use DelProvider {
       delete as protected unsetter;
      }
    }

    Actual result:
    --------------
    The use of function delete() is forbidden; use unset() instead

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedAug 5, '13 at 6:27p
activeAug 7, '13 at 6:22a
posts3
users2
websitepear.php.net

2 users in discussion

Luke: 2 posts Gsherwood: 1 post

People

Translate

site design / logo © 2023 Grokbase