ID: 19208
Updated by: [email protected]
Reported By: php at wallbash dot com
Summary: UpperCaseConstantName reports class members
-Status: Open
+Status: Closed
Type: Bug
Package: PHP_CodeSniffer
Operating System: Linux
Package Version: 1.3.2
PHP Version: 5.3.8
-Assigned To:
+Assigned To: squiz
Roadmap Versions:
New Comment:
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: squiz
Fixed in git repo
Previous Comments:
------------------------------------------------------------------------
[2012-01-09 14:02:45] edorian
Description:
------------
If a class has a member named null, true or false the constant sniff
will report an issue as it thinks the reference to that member is a
constant.
F.e.
$x->null = 6;
will produce a warning.
Thanks,
edo
Test script:
---------------
foo.php:
-------------------
<?php
$x = new stdClass();
$x->null = 7;
-------------------
phpcs --standard=Generic foo.php
Expected result:
----------------
No error
Actual result:
--------------
4 | ERROR | TRUE, FALSE and NULL must be uppercase; expected "NULL"
but
found "null"