示例#1
0
 /**
  * Instatiates a Notification object.
  *
  * @param string  $msg       The text to display next to the Notifier.
  * @param int     $dots      The number of dots to iterate through.
  * @param int     $interval  The interval in milliseconds between updates.
  * @throws \InvalidArgumentException
  */
 public function __construct($msg, $dots = 3, $interval = 100)
 {
     parent::__construct($msg, $interval);
     $this->_dots = (int) $dots;
     if ($this->_dots <= 0) {
         throw new \InvalidArgumentException('Dot count out of range, must be positive.');
     }
 }
示例#2
0
 /**
  * Instantiates a Progress Notifier.
  *
  * @param string  $msg       The text to display next to the Notifier.
  * @param int     $total     The total number of ticks we will be performing.
  * @param int     $interval  The interval in milliseconds between updates.
  * @throws \InvalidArgumentException  Thrown if `$total` is less than 0.
  */
 public function __construct($msg, $total, $interval = 100)
 {
     parent::__construct($msg, $interval);
     $this->_total = (int) $total;
     if ($this->_total < 0) {
         throw new \InvalidArgumentException('Maximum value out of range, must be positive.');
     }
 }
示例#3
0
 /**
  * Instantiates a Progress Notifier.
  *
  * @param string  $msg       The text to display next to the Notifier.
  * @param int     $total     The total number of ticks we will be performing.
  * @param int     $interval  The interval in milliseconds between updates.
  * @see cli\Progress::setTotal()
  */
 public function __construct($msg, $total, $interval = 100)
 {
     parent::__construct($msg, $interval);
     $this->setTotal($total);
 }