1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-11-30 04:19:30 +01: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
commit 05e2cd287e

View File

@ -21,7 +21,15 @@ abstract class NodeAbstract implements Node, \JsonSerializable
* @return string Type of the node
*/
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
),
'\\',
'_'
);
}
/**