/**
  * @param AbstractTask|null $task
  */
 public function __construct(AbstractTask $task = null)
 {
     parent::__construct();
     // If we passed a Task, bind its properties
     // to the command
     if ($task) {
         $this->task = $task;
         $this->task->command = $this;
         if (!$this->description && ($description = $task->getDescription())) {
             $this->setDescription($description);
         }
     }
 }
Example #2
0
 /**
  * Get what the task does.
  *
  * @return string
  */
 public function getDescription()
 {
     $flattened = (array) $this->getStringTask();
     $flattened = implode('/', $flattened);
     return parent::getDescription() ?: $flattened;
 }