Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15404216
D12270.id29566.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
831 B
Referenced Files
None
Subscribers
None
D12270.id29566.diff
View Options
diff --git a/src/parser/xhpast/api/XHPASTNode.php b/src/parser/xhpast/api/XHPASTNode.php
--- a/src/parser/xhpast/api/XHPASTNode.php
+++ b/src/parser/xhpast/api/XHPASTNode.php
@@ -105,7 +105,7 @@
}
}
- public function isConstantString() {
+ public function isConstantString(array $additional_types = array()) {
switch ($this->getTypeName()) {
case 'n_HEREDOC':
case 'n_STRING_SCALAR':
@@ -123,10 +123,18 @@
return true;
default:
+ if (in_array($this->getTypeName(), $additional_types)) {
+ return true;
+ }
+
return false;
}
}
+ public function isConstantStringWithMagicConstants() {
+ return $this->isConstantString(array('n_MAGIC_SCALAR'));
+ }
+
public function getStringVariables() {
$value = $this->getConcreteString();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 19, 6:49 AM (2 w, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7710968
Default Alt Text
D12270.id29566.diff (831 B)
Attached To
Mode
D12270: Consider magic scalars to be constant strings
Attached
Detach File
Event Timeline
Log In to Comment