Skip to content

Commit fcdf791

Browse files
committed
use string concatenation instead of sprintf
1 parent 7511e25 commit fcdf791

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Index/Index.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,9 @@ private function yieldDefinitionsRecursively(array &$storage, string $prefix = '
292292
{
293293
foreach ($storage as $key => $value) {
294294
if (!is_array($value)) {
295-
yield sprintf('%s%s', $prefix, $key) => $value;
295+
yield $prefix.$key => $value;
296296
} else {
297-
yield from $this->yieldDefinitionsRecursively($value, sprintf('%s%s', $prefix, $key));
297+
yield from $this->yieldDefinitionsRecursively($value, $prefix.$key);
298298
}
299299
}
300300
}
@@ -319,12 +319,12 @@ private function splitFqn(string $fqn): array
319319
$parts = array_slice($parts, 1);
320320
}
321321

322-
$parts[0] = sprintf('\\%s', $parts[0]);
322+
$parts[0] = '\\'.$parts[0];
323323
}
324324

325325
// write back the backslashes prefixes for the other parts
326326
for ($i = 1; $i < count($parts); $i++) {
327-
$parts[$i] = sprintf('\\%s', $parts[$i]);
327+
$parts[$i] = '\\'.$parts[$i];
328328
}
329329

330330
// split the last part in 2 parts at the operator
@@ -337,7 +337,7 @@ private function splitFqn(string $fqn): array
337337
// replace the last part by its pieces
338338
array_pop($parts);
339339
$parts[] = $endParts[0];
340-
$parts[] = sprintf('%s%s', $operator, $endParts[1]);
340+
$parts[] = $operator.$endParts[1];
341341
break;
342342
}
343343
}

0 commit comments

Comments
 (0)