mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-30 04:29:15 +01:00
Replace string by class call (#477)
For better PHP-Scoper compatibility
This commit is contained in:
parent
08215e7646
commit
1c3eabb000
@ -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),
|
||||
'\\',
|
||||
'_'
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user