mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-07-26 00:31:22 +02:00
Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
579f4ce846 | ||
|
94ca9a7ab9 | ||
|
bac91b426e |
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,8 +1,16 @@
|
|||||||
Version 3.1.3-dev
|
Version 3.1.4-dev
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
Nothing yet.
|
Nothing yet.
|
||||||
|
|
||||||
|
Version 3.1.3 (2017-12-26)
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
* Improve compatibility with php-scoper, by supporting prefixed namespaces in
|
||||||
|
`NodeAbstract::getType()`.
|
||||||
|
|
||||||
Version 3.1.2 (2017-11-04)
|
Version 3.1.2 (2017-11-04)
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
|
@@ -360,7 +360,7 @@ class Lexer
|
|||||||
if ('T_HASHBANG' === $name) {
|
if ('T_HASHBANG' === $name) {
|
||||||
// HHVM uses a special token for #! hashbang lines
|
// HHVM uses a special token for #! hashbang lines
|
||||||
$tokenMap[$i] = Tokens::T_INLINE_HTML;
|
$tokenMap[$i] = Tokens::T_INLINE_HTML;
|
||||||
} else if (defined($name = 'PhpParser\Parser\Tokens::' . $name)) {
|
} else if (defined($name = Tokens::class . '::' . $name)) {
|
||||||
// Other tokens can be mapped directly
|
// Other tokens can be mapped directly
|
||||||
$tokenMap[$i] = constant($name);
|
$tokenMap[$i] = constant($name);
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,15 @@ abstract class NodeAbstract implements Node, \JsonSerializable
|
|||||||
* @return string Type of the node
|
* @return string Type of the node
|
||||||
*/
|
*/
|
||||||
public function getType() {
|
public function getType() {
|
||||||
return strtr(substr(rtrim(get_class($this), '_'), 15), '\\', '_');
|
$className = rtrim(get_class($this), '_');
|
||||||
|
return strtr(
|
||||||
|
substr(
|
||||||
|
$className,
|
||||||
|
strpos($className, 'PhpParser\Node') + 15
|
||||||
|
),
|
||||||
|
'\\',
|
||||||
|
'_'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user