30
30
use PhpParser \Node \Stmt \Property ;
31
31
use PhpParser \Node \Stmt \Return_ as Stmt_Return ;
32
32
use StubsGenerator \NodeVisitor ;
33
+ use phpDocumentor \Reflection \DocBlockFactoryInterface ;
34
+ use phpDocumentor \Reflection \DocBlockFactory ;
35
+ use function assert ;
33
36
34
37
// phpcs:disable SlevomatCodingStandard.Functions.FunctionLength.FunctionLength,NeutronStandard.Functions.TypeHint.NoReturnType
35
38
@@ -40,7 +43,7 @@ class Visitor extends NodeVisitor
40
43
*/
41
44
private const WP_INDENT_SIZE = 4 ;
42
45
43
- private \ phpDocumentor \ Reflection \ DocBlockFactoryInterface $ docBlockFactory ;
46
+ private DocBlockFactoryInterface $ docBlockFactory ;
44
47
45
48
/** @var array<string,array<int|string,string>> */
46
49
private array $ functionMap ;
@@ -51,11 +54,11 @@ class Visitor extends NodeVisitor
51
54
/** @var array<string, list<string>> */
52
55
private array $ additionalTagStrings = [];
53
56
54
- private \ PhpParser \ NodeFinder $ nodeFinder ;
57
+ private NodeFinder $ nodeFinder ;
55
58
56
59
public function __construct ()
57
60
{
58
- $ this ->docBlockFactory = \ phpDocumentor \ Reflection \ DocBlockFactory::createInstance ();
61
+ $ this ->docBlockFactory = DocBlockFactory::createInstance ();
59
62
$ this ->nodeFinder = new NodeFinder ();
60
63
$ this ->functionMap = require sprintf ('%s/functionMap.php ' , dirname (__DIR__ ));
61
64
}
@@ -124,15 +127,15 @@ private function getSymbolName(Node $node): string
124
127
$ name = $ node ->props [0 ]->name ->name ;
125
128
}
126
129
127
- \ assert (isset ($ name ), 'Node does not have a name ' );
130
+ assert (isset ($ name ), 'Node does not have a name ' );
128
131
129
132
if ($ node instanceof Function_ || $ node instanceof Class_) {
130
133
return $ name ;
131
134
}
132
135
133
136
$ parent = $ this ->stack [count ($ this ->stack ) - 2 ];
134
- \ assert ($ parent instanceof \ PhpParser \ Node \ Stmt \ ClassLike);
135
- \ assert ($ parent ->name instanceof \ PhpParser \ Node \ Identifier);
137
+ assert ($ parent instanceof ClassLike);
138
+ assert ($ parent ->name instanceof Identifier);
136
139
137
140
return sprintf (
138
141
'%1$s::%2$s%3$s ' ,
0 commit comments