PHP Class Platformsh\Cli\Util\ConsoleAnimation

Show file Open project: commerceguys/platform-cli Class Usage Examples

Protected Properties

Property Type Description
$currentFrame
$frames
$interval
$lastFrame
$lastFrameTime
$output

Public Methods

Method Description
__construct ( Symfony\Component\Console\Output\OutputInterface $output, array $frames, integer $interval = 500000 )
render ( string $placeholder = '.' ) Display the current frame, and advance the pointer to the next one.

Method Details

__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.

render() public method

If the output is capable of using ANSI escape codes, this will attempt to overwrite the previous frame. But if the output is not ANSI-compatible, this will display the $placeholder instead. So, to display an endless animation only where it's safe, use: $animation = new ConsoleAnimation($output, $frames); do { $animation->render(); } while ($output->isDecorated());
public render ( string $placeholder = '.' )
$placeholder string

Property Details

$currentFrame protected property

protected $currentFrame

$frames protected property

protected $frames

$interval protected property

protected $interval

$lastFrame protected property

protected $lastFrame

$lastFrameTime protected property

protected $lastFrameTime

$output protected property

protected $output