Skip to content

Commit

Permalink
[Console] Misuse of str_pad instead of str_repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
nanocom committed Sep 15, 2012
1 parent 61d57f7 commit cc58b30
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/Console/Input/InputDefinition.php
Expand Up @@ -433,7 +433,7 @@ public function asText()
$default = '';
}

$description = str_replace("\n", "\n".str_pad('', $max + 2, ' '), $argument->getDescription());
$description = str_replace("\n", "\n".str_repeat(' ', $max + 2), $argument->getDescription());

$text[] = sprintf(" <info>%-${max}s</info> %s%s", $argument->getName(), $description, $default);
}
Expand All @@ -452,7 +452,7 @@ public function asText()
}

$multiple = $option->isArray() ? '<comment> (multiple values allowed)</comment>' : '';
$description = str_replace("\n", "\n".str_pad('', $max + 2, ' '), $option->getDescription());
$description = str_replace("\n", "\n".str_repeat(' ', $max + 2), $option->getDescription());

$optionMax = $max - strlen($option->getName()) - 2;
$text[] = sprintf(" <info>%s</info> %-${optionMax}s%s%s%s",
Expand Down

0 comments on commit cc58b30

Please sign in to comment.