diff --git a/src/Composer/Json/JsonFormatter.php b/src/Composer/Json/JsonFormatter.php index 8ea6f7509..e75012fa3 100644 --- a/src/Composer/Json/JsonFormatter.php +++ b/src/Composer/Json/JsonFormatter.php @@ -108,9 +108,7 @@ class JsonFormatter // If this character is the end of an element, // output a new line and indent the next line $result .= $newLine; - for ($j = 0; $j < $pos; $j++) { - $result .= $indentStr; - } + $result .= str_repeat($indentStr, $pos); } else { // Collapse empty {} and [] $result = rtrim($result); @@ -128,9 +126,7 @@ class JsonFormatter $pos++; } - for ($j = 0; $j < $pos; $j++) { - $result .= $indentStr; - } + $result .= str_repeat($indentStr, $pos); } }