1
0
mirror of https://github.com/nikic/PHP-Parser.git synced 2025-07-27 01:10:27 +02:00

Merge branch '3.x'

Conflicts:
	lib/PhpParser/NodeAbstract.php
This commit is contained in:
Nikita Popov
2017-11-12 21:12:27 +01:00

@@ -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() : string { public function getType() : string {
return strtr(substr(rtrim(get_class($this), '_'), 15), '\\', '_'); $className = rtrim(get_class($this), '_');
return strtr(
substr(
$className,
strpos($className, 'PhpParser\Node') + 15
),
'\\',
'_'
);
} }
/** /**