Page MenuHomePhabricator

D12270.diff
No OneTemporary

D12270.diff

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
@@ -106,6 +106,14 @@
}
public function isConstantString() {
+ return $this->checkIsConstantString(array());
+ }
+
+ public function isConstantStringWithMagicConstants() {
+ return $this->checkIsConstantString(array('n_MAGIC_SCALAR'));
+ }
+
+ private function checkIsConstantString(array $additional_types) {
switch ($this->getTypeName()) {
case 'n_HEREDOC':
case 'n_STRING_SCALAR':
@@ -116,13 +124,17 @@
if ($child->getTypeName() == 'n_OPERATOR') {
continue;
}
- if (!$child->isConstantString()) {
+ if (!$child->checkIsConstantString($additional_types)) {
return false;
}
}
return true;
default:
+ if (in_array($this->getTypeName(), $additional_types)) {
+ return true;
+ }
+
return false;
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, Mar 5, 3:55 AM (3 w, 1 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223502
Default Alt Text
D12270.diff (1 KB)

Event Timeline