Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13975343
D11386.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11386.diff
View Options
diff --git a/src/lint/linter/ArcanistXHPASTLinter.php b/src/lint/linter/ArcanistXHPASTLinter.php
--- a/src/lint/linter/ArcanistXHPASTLinter.php
+++ b/src/lint/linter/ArcanistXHPASTLinter.php
@@ -596,7 +596,10 @@
// TODO: Technically, this will include function names. This is unlikely to
// cause any issues (unless, of course, there existed a function that had
// the same name as some constant).
- $constants = $root->selectDescendantsOfType('n_SYMBOL_NAME');
+ $constants = $root->selectDescendantsOfTypes(array(
+ 'n_SYMBOL_NAME',
+ 'n_MAGIC_SCALAR',
+ ));
foreach ($constants as $node) {
$name = $node->getConcreteString();
$version = idx($compat_info['constants'], $name, array());
diff --git a/src/lint/linter/__tests__/xhpast/php53-features.lint-test b/src/lint/linter/__tests__/xhpast/php53-features.lint-test
--- a/src/lint/linter/__tests__/xhpast/php53-features.lint-test
+++ b/src/lint/linter/__tests__/xhpast/php53-features.lint-test
@@ -10,6 +10,7 @@
1 ?: 2;
$a = 'stdClass';
$a::m();
+echo __DIR__;
~~~~~~~~~~
error:3:1
error:4:5
@@ -18,6 +19,7 @@
error:7:3
error:8:1
error:10:1
+error:13:6
~~~~~~~~~~
~~~~~~~~~~
{"config": {"xhpast.php-version": "5.2.3"}}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 19, 9:45 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6731519
Default Alt Text
D11386.diff (1 KB)
Attached To
Mode
D11386: Lint against undefined magic symbols
Attached
Detach File
Event Timeline
Log In to Comment