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

  ID: 19997
  Updated by: gsherwood@squiz.net
  Reported By: shane dot auckland@gmail.com
  Summary: Class names incorrectly detected as constants
-Status: Open
+Status: Closed
  Type: Bug
  Package: PHP_CodeSniffer
  Operating System: CentOS 6.4
  Package Version: 1.4.5
  PHP Version: Irrelevant
-Assigned To:
+Assigned To: squiz
  Roadmap Versions:
  New Comment:

-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: squiz
Fix committed to github repo:

Previous Comments:

[2013-06-26 14:47:37] shanethehat

Class names such as 'True' and 'False' are incorrectly detected as mixed
case constants by the LowerCaseConstantSniff. An example block of code
from a real world application follows, running the PSR2 ruleset against
it results in a false error being raised against the use of the Symfony
True constraint object.

PHP version is CentOS6.4 default package version of 5.3.3.

Test script:
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints\True;

class MyFormType extends AbstractType
     public function buildForm(FormBuilderInterface $builder, array
                 'constraints' => new True(
                         'message' => 'Constraint message'

Expected result:
Running the PSR2 ruleset against the provided code should not consider
the True constraint object to be a constant.

Actual result:
Running the PSR2 ruleset against the provided code presents the error:
'TRUE, FALSE and NULL must be lowercasecase; expected "true" but found


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
postedJun 26, '13 at 11:16p
activeJun 26, '13 at 11:16p

1 user in discussion

Gsherwood: 1 post



site design / logo © 2022 Grokbase