/** * Get the handle matching a task. * * @param string $slug * @param AbstractTask $task * * @return string|null */ public function getTaskHandle($slug, AbstractTask $task = null) { $slug = $slug || !$task ? $slug : $task->getSlug(); if ($slug === 'closure') { return; } return $slug; }
/** * @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); } } }
/** * @param AbstractTask $task * @param double[] $past */ protected function saveTaskTimes(AbstractTask $task, array $past) { $handle = sprintf('times.%s', $task->getSlug()); $this->localStorage->set($handle, $past); }
/** * Get what the task does. * * @return string */ public function getDescription() { $flattened = (array) $this->getStringTask(); $flattened = implode('/', $flattened); return parent::getDescription() ?: $flattened; }
/** * @param Container $app */ public function __construct(Container $app) { parent::__construct($app); $this->serverStorage = new ServerStorage($this->app, 'state'); }
function __construct(Container $app, $drushPlugin) { parent::__construct($app); $this->drush = $this->binary($drushPlugin->binaryPath); $this->drushPlugin = $drushPlugin; }