File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,13 @@ private function extractUseStatement(\ArrayIterator $tokens)
168
168
}
169
169
170
170
if (count ($ result ) == 1 ) {
171
- $ result [] = substr ($ result [0 ], strrpos ($ result [0 ], '\\' ) + 1 );
171
+ $ backslashPos = strrpos ($ result [0 ], '\\' );
172
+
173
+ if (false !== $ backslashPos ) {
174
+ $ result [] = substr ($ result [0 ], $ backslashPos + 1 );
175
+ } else {
176
+ $ result [] = $ result [0 ];
177
+ }
172
178
}
173
179
174
180
return array_reverse ($ result );
Original file line number Diff line number Diff line change 16
16
use Mockery as m ;
17
17
use phpDocumentor \Reflection \DocBlock ,
18
18
phpDocumentor \Reflection \DocBlock \Tag ;
19
+ use phpDocumentor ;
19
20
use \ReflectionClass ; // yes, the slash is part of the test
20
21
21
22
/**
@@ -49,6 +50,7 @@ public function testReadsAliasesFromClassReflection()
49
50
'm ' => 'Mockery ' ,
50
51
'DocBlock ' => 'phpDocumentor\Reflection\DocBlock ' ,
51
52
'Tag ' => 'phpDocumentor\Reflection\DocBlock\Tag ' ,
53
+ 'phpDocumentor ' => 'phpDocumentor ' ,
52
54
'ReflectionClass ' => 'ReflectionClass '
53
55
];
54
56
$ context = $ fixture ->createFromReflector (new ReflectionClass ($ this ));
@@ -79,6 +81,7 @@ public function testReadsAliasesFromProvidedNamespaceAndContent()
79
81
'm ' => 'Mockery ' ,
80
82
'DocBlock ' => 'phpDocumentor\Reflection\DocBlock ' ,
81
83
'Tag ' => 'phpDocumentor\Reflection\DocBlock\Tag ' ,
84
+ 'phpDocumentor ' => 'phpDocumentor ' ,
82
85
'ReflectionClass ' => 'ReflectionClass '
83
86
];
84
87
$ context = $ fixture ->createForNamespace (__NAMESPACE__ , file_get_contents (__FILE__ ));
You can’t perform that action at this time.
0 commit comments