File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -247,14 +247,20 @@ private function mapToCodeUnits(CoversClass|CoversFunction|CoversMethod|UsesClas
247
247
}
248
248
}
249
249
250
- $ codeUnits = CodeUnitCollection::fromList ();
251
-
252
250
try {
251
+ if (count ($ names ) === 1 ) {
252
+ return $ mapper ->stringToCodeUnits ($ names [0 ]);
253
+ }
254
+
255
+ $ codeUnits = CodeUnitCollection::fromList ();
256
+
253
257
foreach ($ names as $ name ) {
254
258
$ codeUnits = $ codeUnits ->mergeWith (
255
259
$ mapper ->stringToCodeUnits ($ name ),
256
260
);
257
261
}
262
+
263
+ return $ codeUnits ;
258
264
} catch (CodeUnitException $ e ) {
259
265
if ($ metadata ->isCoversClass () || $ metadata ->isUsesClass ()) {
260
266
if (interface_exists ($ metadata ->className ())) {
@@ -276,7 +282,5 @@ private function mapToCodeUnits(CoversClass|CoversFunction|CoversMethod|UsesClas
276
282
$ e ,
277
283
);
278
284
}
279
-
280
- return $ codeUnits ;
281
285
}
282
286
}
You can’t perform that action at this time.
0 commit comments