From fcdf791c2c00afabb47fb25e665c08623885dbef Mon Sep 17 00:00:00 2001 From: Nicolas MURE Date: Thu, 16 Nov 2017 17:44:04 +0100 Subject: [PATCH] use string concatenation instead of sprintf --- src/Index/Index.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Index/Index.php b/src/Index/Index.php index 203b881..7088e03 100644 --- a/src/Index/Index.php +++ b/src/Index/Index.php @@ -292,9 +292,9 @@ class Index implements ReadableIndex, \Serializable { foreach ($storage as $key => $value) { if (!is_array($value)) { - yield sprintf('%s%s', $prefix, $key) => $value; + yield $prefix.$key => $value; } else { - yield from $this->yieldDefinitionsRecursively($value, sprintf('%s%s', $prefix, $key)); + yield from $this->yieldDefinitionsRecursively($value, $prefix.$key); } } } @@ -319,12 +319,12 @@ class Index implements ReadableIndex, \Serializable $parts = array_slice($parts, 1); } - $parts[0] = sprintf('\\%s', $parts[0]); + $parts[0] = '\\'.$parts[0]; } // write back the backslashes prefixes for the other parts for ($i = 1; $i < count($parts); $i++) { - $parts[$i] = sprintf('\\%s', $parts[$i]); + $parts[$i] = '\\'.$parts[$i]; } // split the last part in 2 parts at the operator @@ -337,7 +337,7 @@ class Index implements ReadableIndex, \Serializable // replace the last part by its pieces array_pop($parts); $parts[] = $endParts[0]; - $parts[] = sprintf('%s%s', $operator, $endParts[1]); + $parts[] = $operator.$endParts[1]; break; } }