src/mako/cli/output/helpers/Countdown.php
public function draw(int $from = 5): void
	{
		$dots = 0;

		$fromLength = strlen($from);

		$totalLength = $fromLength + 5;

		do
		{
			do
			{
				$numbers = str_pad($from, $fromLength, '0', STR_PAD_LEFT);

				$this->output->write("\r" . str_pad($numbers . ' ' . str_repeat('.', $dots) . ' ', $totalLength, ' '));

				$this->sleep();
			}
			while($dots++ < 3);

			$dots = 0;
		}
		while($from-- > 1);

		$this->output->write("\r" . str_repeat(' ', $totalLength) . "\r");
	}
public function draw(int $from = 5): void
	{
		$dots = 0;

		$fromLength = strlen($from);

		$totalLength = $fromLength + 5;

		do
		{
			do
			{
				$numbers = str_pad($from, $fromLength, '0', STR_PAD_LEFT);

				$this->output->write("\r" . str_pad($numbers . ' ' . str_repeat('.', $dots) . ' ', $totalLength, ' '));

				$this->sleep();
			}
			while($dots++ < 3);

			$dots = 0;
		}
		while($from-- > 1);

		$this->output->write("\r" . str_repeat(' ', $totalLength) . "\r");
	}
public function draw ( int $ from = 5 ) : void { $ dots = 0 ; $ fromLength = strlen ( $ from ) ; $ totalLength = $ fromLength + 5 ; do { do { $ numbers = str_pad ( $ from , $ fromLength , '0' , STR_PAD_LEFT ) ; $ this -> output -> write ( "\r" . str_pad ( $ numbers . ' ' . str_repeat ( '.' , $ dots ) . ' ' , $ totalLength , ' ' ) ) ; $ this -> sleep ( ) ; } while ( $ dots ++ < 3 ) ; $ dots = 0 ; } while ( $ from -- > 1 ) ; $ this -> output -> write ( "\r" . str_repeat ( ' ' , $ totalLength ) . "\r" ) ; }
Counts down from n.

@param int $from Number of seconds to count down
Counts down from n .