for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace League\CLImate\TerminalObject\Dynamic;
final class Countdown extends DynamicTerminalObject
{
/** @var string */
private $label = "";
/**
* @param string $label
*/
public function __construct(string $label = "Starting in... ")
$this->label = $label;
}
* @param int $from
public function from(int $from): void
$firstLine = true;
$i = $from;
while ($i-- > 0) {
$content = "";
if ($firstLine) {
$firstLine = false;
} else {
$content .= $this->util->cursor->up(1);
$content .= $this->util->cursor->startOfCurrentLine();
$content .= $this->util->cursor->deleteCurrentLine();
$content .= $this->label;
$content .= $i;
$this->output->write($this->parser->apply($content));
sleep(1);