Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15330478
D12294.id29520.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
D12294.id29520.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
@@ -3,8 +3,10 @@
final class XHPASTNode extends AASTNode {
public function isStaticScalar() {
- return ($this->getTypeName() == 'n_STRING_SCALAR' ||
- $this->getTypeName() == 'n_NUMERIC_SCALAR');
+ return in_array($this->getTypeName(), array(
+ 'n_STRING_SCALAR',
+ 'n_NUMERIC_SCALAR',
+ ));
}
public function getDocblockToken() {
@@ -55,7 +57,7 @@
case 'null':
return null;
default:
- throw new Exception('Unrecognized symbol name.');
+ throw new Exception(pht('Unrecognized symbol name.'));
}
break;
case 'n_UNARY_PREFIX_EXPRESSION':
@@ -69,7 +71,8 @@
return $operand->evalStatic();
break;
default:
- throw new Exception('Unexpected operator in static expression.');
+ throw new Exception(
+ pht('Unexpected operator in static expression.'));
}
break;
case 'n_ARRAY_LITERAL':
@@ -141,7 +144,7 @@
break;
default:
- throw new Exception('Unexpected type '.$this->getTypeName().'.');
+ throw new Exception(pht('Unexpected type %s.', $this->getTypeName()));
}
// We extract just the variable names and ignore properties and array keys.
diff --git a/src/parser/xhpast/api/XHPASTTree.php b/src/parser/xhpast/api/XHPASTTree.php
--- a/src/parser/xhpast/api/XHPASTTree.php
+++ b/src/parser/xhpast/api/XHPASTTree.php
@@ -14,12 +14,7 @@
return new XHPASTNode($id, $data, $tree);
}
- public function newToken(
- $id,
- $type,
- $value,
- $offset,
- AASTTree $tree) {
+ public function newToken($id, $type, $value, $offset, AASTTree $tree) {
return new XHPASTToken($id, $type, $value, $offset, $tree);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 8 2025, 7:43 AM (6 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7379273
Default Alt Text
D12294.id29520.diff (1 KB)
Attached To
Mode
D12294: `pht`ize some strings
Attached
Detach File
Event Timeline
Log In to Comment