File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -247,14 +247,20 @@ private function mapToCodeUnits(CoversClass|CoversFunction|CoversMethod|UsesClas
247247 }
248248 }
249249
250- $ codeUnits = CodeUnitCollection::fromList ();
251-
252250 try {
251+ if (count ($ names ) === 1 ) {
252+ return $ mapper ->stringToCodeUnits ($ names [0 ]);
253+ }
254+
255+ $ codeUnits = CodeUnitCollection::fromList ();
256+
253257 foreach ($ names as $ name ) {
254258 $ codeUnits = $ codeUnits ->mergeWith (
255259 $ mapper ->stringToCodeUnits ($ name ),
256260 );
257261 }
262+
263+ return $ codeUnits ;
258264 } catch (CodeUnitException $ e ) {
259265 if ($ metadata ->isCoversClass () || $ metadata ->isUsesClass ()) {
260266 if (interface_exists ($ metadata ->className ())) {
@@ -276,7 +282,5 @@ private function mapToCodeUnits(CoversClass|CoversFunction|CoversMethod|UsesClas
276282 $ e ,
277283 );
278284 }
279-
280- return $ codeUnits ;
281285 }
282286}
You can’t perform that action at this time.
0 commit comments