@@ -52,7 +52,7 @@ class UnitCollectingVisitor extends NodeVisitorAbstract {
52
52
/**
53
53
* @var \TheSeer\phpDox\DocBlock\Parser
54
54
*/
55
- private $ dockblocParser ;
55
+ private $ docBlockParser ;
56
56
57
57
/**
58
58
* @var array
@@ -85,7 +85,7 @@ class UnitCollectingVisitor extends NodeVisitorAbstract {
85
85
* @param ParseResult $result
86
86
*/
87
87
public function __construct (DocBlockParser $ parser , ParseResult $ result ) {
88
- $ this ->dockblocParser = $ parser ;
88
+ $ this ->docBlockParser = $ parser ;
89
89
$ this ->result = $ result ;
90
90
}
91
91
@@ -99,14 +99,17 @@ public function enterNode(\PhpParser\Node $node) {
99
99
} else if ($ node instanceof NodeType \UseUse) {
100
100
$ this ->aliasMap [$ node ->alias ] = join ('\\' , $ node ->name ->parts );
101
101
} else if ($ node instanceof NodeType \Class_) {
102
+ $ this ->aliasMap ['::unit ' ] = (string )$ node ->namespacedName ;
102
103
$ this ->unit = $ this ->result ->addClass ((string )$ node ->namespacedName );
103
104
$ this ->processUnit ($ node );
104
105
return ;
105
106
} else if ($ node instanceof NodeType \Interface_) {
107
+ $ this ->aliasMap ['::unit ' ] = (string )$ node ->namespacedName ;
106
108
$ this ->unit = $ this ->result ->addInterface ((string )$ node ->namespacedName );
107
109
$ this ->processUnit ($ node );
108
110
return ;
109
111
} else if ($ node instanceof NodeType \Trait_) {
112
+ $ this ->aliasMap ['::unit ' ] = (string )$ node ->namespacedName ;
110
113
$ this ->unit = $ this ->result ->addTrait ((string )$ node ->namespacedName );
111
114
$ this ->processUnit ($ node );
112
115
return ;
@@ -151,7 +154,7 @@ private function processUnit($node) {
151
154
152
155
$ docComment = $ node ->getDocComment ();
153
156
if ($ docComment !== NULL ) {
154
- $ block = $ this ->dockblocParser ->parse ($ docComment , $ this ->aliasMap );
157
+ $ block = $ this ->docBlockParser ->parse ($ docComment , $ this ->aliasMap );
155
158
$ this ->unit ->setDocBlock ($ block );
156
159
}
157
160
@@ -234,7 +237,7 @@ private function processMethod(NodeType\ClassMethod $node) {
234
237
$ method ->setVisibility ($ visibility );
235
238
$ docComment = $ node ->getDocComment ();
236
239
if ($ docComment !== NULL ) {
237
- $ block = $ this ->dockblocParser ->parse ($ docComment , $ this ->aliasMap );
240
+ $ block = $ this ->docBlockParser ->parse ($ docComment , $ this ->aliasMap );
238
241
$ method ->setDocBlock ($ block );
239
242
}
240
243
$ this ->processMethodParams ($ method , $ node ->params );
@@ -280,7 +283,7 @@ private function processClassConstant(NodeType\ClassConst $node) {
280
283
$ const ->setValue ($ constNode ->getAttribute ('originalValue ' ));
281
284
$ docComment = $ node ->getDocComment ();
282
285
if ($ docComment !== NULL ) {
283
- $ block = $ this ->dockblocParser ->parse ($ docComment , $ this ->aliasMap );
286
+ $ block = $ this ->docBlockParser ->parse ($ docComment , $ this ->aliasMap );
284
287
$ const ->setDocBlock ($ block );
285
288
}
286
289
}
@@ -299,7 +302,7 @@ private function processProperty(NodeType\Property $node) {
299
302
$ member ->setVisibility ($ visibility );
300
303
$ docComment = $ node ->getDocComment ();
301
304
if ($ docComment !== NULL ) {
302
- $ block = $ this ->dockblocParser ->parse ($ docComment , $ this ->aliasMap );
305
+ $ block = $ this ->docBlockParser ->parse ($ docComment , $ this ->aliasMap );
303
306
$ member ->setDocBlock ($ block );
304
307
}
305
308
$ member ->setLine ($ node ->getLine ());
0 commit comments