コード例 #1
0
ファイル: ProgressSubscriber.php プロジェクト: phpro/grumphp
 /**
  * @param TaskEvent $event
  */
 public function advanceProgress(TaskEvent $event)
 {
     $taskReflection = new ReflectionClass($event->getTask());
     $taskName = $taskReflection->getShortName();
     $this->progressBar->setFormat($this->progressFormat);
     $this->progressBar->setMessage($taskName);
     $this->progressBar->advance();
 }
コード例 #2
0
 function it_should_advance_progress(ProgressBar $progressBar, TaskEvent $event, TaskInterface $task)
 {
     $event->getTask()->willReturn($task);
     $progressBar->setFormat(Argument::type('string'))->shouldBeCalled();
     $progressBar->setOverwrite(false)->shouldBeCalled();
     $progressBar->setMessage(Argument::type('string'))->shouldBeCalled();
     $progressBar->advance()->shouldBeCalled();
     $this->advanceProgress($event);
 }
コード例 #3
0
ファイル: TaskFailedEvent.php プロジェクト: spinx/grumphp
 /**
  * @param TaskInterface $task
  * @param Exception     $exception
  */
 public function __construct(TaskInterface $task, Exception $exception)
 {
     parent::__construct($task);
     $this->exception = $exception;
 }