Platformsh\Cli\Util\ConsoleAnimation::__construct PHP Method

__construct() public method

public __construct ( Symfony\Component\Console\Output\OutputInterface $output, array $frames, integer $interval = 500000 )
$output Symfony\Component\Console\Output\OutputInterface
$frames array The frames to display. Like any animation, this works best if the frames are all the same size.
$interval integer Minimum interval between frames in microseconds.
    public function __construct(OutputInterface $output, array $frames, $interval = 500000)
    {
        $this->output = $output;
        $this->frames = $frames;
        $this->interval = $interval;
    }

Usage Example

Example #1
0
 /**
  * @param OutputInterface $output
  */
 public function __construct(OutputInterface $output)
 {
     $filenames = [CLI_ROOT . '/resources/bot/bot1', CLI_ROOT . '/resources/bot/bot2', CLI_ROOT . '/resources/bot/bot3', CLI_ROOT . '/resources/bot/bot4'];
     // The frames are the contents of each file, with each line indented.
     $frames = array_map(function ($filename) {
         return preg_replace('/^/m', '    ', file_get_contents($filename)) . "\n    <info>Platform.sh</info>";
     }, $filenames);
     parent::__construct($output, $frames);
 }
All Usage Examples Of Platformsh\Cli\Util\ConsoleAnimation::__construct
ConsoleAnimation