mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-06-25 09:32:39 +02:00
Merge branch '3.x'
Conflicts: lib/PhpParser/NodeAbstract.php
This commit is contained in:
@ -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
|
||||||
|
),
|
||||||
|
'\\',
|
||||||
|
'_'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user