Skip to content

Instantly share code, notes, and snippets.

@mustafo
Created May 21, 2020 10:18
Show Gist options
  • Save mustafo/8f0b3fc9d6e253c86b92e783bd2c6467 to your computer and use it in GitHub Desktop.
Save mustafo/8f0b3fc9d6e253c86b92e783bd2c6467 to your computer and use it in GitHub Desktop.
IProgressMonitor interface
<?php
namespace App\Core\Utils\ProgressMonitor;
interface IProgressMonitor {
/**
* Starts a new progress monitor
*
* @param string $title The title of progress monitor
* @param int|null $max
*/
public function start(string $title, int $max = null);
/**
* Advances the progress output X steps.
*
* @param int $step Number of steps to advance
* @param string|null $message
*/
public function advance(int $step = 1, ?string $message = null);
/**
* Sets progress of progress monitor
*
* @param int $progress
*/
public function setProgress(int $progress);
/**
* @param int $max
*/
public function setMax(int $max);
/**
* Shows a message in progress monitor
*
* @param string $message
*/
public function message(string $message);
/**
* Finishes the progress output with specified message.
*
* @param string|null $message
*/
public function finish(string $message = null);
/**
* Aborts progress monitor
*
* @return void
*/
public function abort();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment