Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[Console] Fixes in ProgressHelper

  • Loading branch information...
commit 3eeaa72d00ff5e070917a18308fa59e6eacd1972 1 parent 3d40994
@nanocom nanocom authored
View
4 Helper/DialogHelper.php
@@ -130,9 +130,7 @@ public function getInputStream()
}
/**
- * Returns the helper's canonical name.
- *
- * @return string The helper name
+ * {@inheritDoc}
*/
public function getName()
{
View
4 Helper/FormatterHelper.php
@@ -91,9 +91,7 @@ private function strlen($string)
}
/**
- * Returns the helper's canonical name.
- *
- * @return string The canonical name of the helper
+ * {@inheritDoc}
*/
public function getName()
{
View
27 Helper/ProgressHelper.php
@@ -296,6 +296,7 @@ private function initialize()
* Generates the array map of format variables to values.
*
* @param Boolean $finish Forces the end result
+ *
* @return array Array of format vars and values
*/
private function generate($finish = false)
@@ -353,6 +354,7 @@ private function generate($finish = false)
* Converts seconds into human-readable format.
*
* @param integer $secs Number of seconds
+ *
* @return string Time in readable format
*/
private function humaneTime($secs)
@@ -369,6 +371,7 @@ private function humaneTime($secs)
}
}
}
+
return $text;
}
@@ -380,32 +383,22 @@ private function humaneTime($secs)
* @param Boolean $newline Whether to add a newline or not
* @param integer $size The size of line
*/
- private function overwrite(OutputInterface $output, $messages, $newline = true, $size = 80)
+ private function overwrite(OutputInterface $output, $messages, $newline = false, $size = 80)
{
- for ($place = $size; $place > 0; $place--) {
- $output->write("\x08", false);
- }
-
- $output->write($messages, false);
-
- for ($place = ($size - strlen($messages)); $place > 0; $place--) {
- $output->write(' ', false);
- }
+ $output->write(str_repeat("\x08", $size));
+ $output->write($messages);
+ $output->write(str_repeat(' ', $size - strlen($messages)));
// clean up the end line
- for ($place = ($size - strlen($messages)); $place > 0; $place--) {
- $output->write("\x08", false);
- }
+ $output->write(str_repeat("\x08", $size - strlen($messages)));
if ($newline) {
- $output->write('');
+ $output->writeln('');
}
}
/**
- * Returns the canonical name of this helper.
- *
- * @return string The canonical name
+ * {@inheritDoc}
*/
public function getName()
{
Please sign in to comment.
Something went wrong with that request. Please try again.