Skip to content
Snippets Groups Projects
Commit 1c3eabb0 authored by Théo FIDRY's avatar Théo FIDRY Committed by Nikita Popov
Browse files

Replace string by class call (#477)

For better PHP-Scoper compatibility
parent 08215e76
Branches
Tags 9.5.19
No related merge requests found
......@@ -2,6 +2,8 @@
namespace PhpParser;
use PhpParser\Node;
abstract class NodeAbstract implements Node, \JsonSerializable
{
protected $attributes;
......@@ -23,10 +25,7 @@ abstract class NodeAbstract implements Node, \JsonSerializable
public function getType() {
$className = rtrim(get_class($this), '_');
return strtr(
substr(
$className,
strpos($className, 'PhpParser\Node') + 15
),
substr($className, strlen(Node::class) + 1),
'\\',
'_'
);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment