/** * Handle undefined methods by attempting to instantiate the task matching the * method name. * * @param string $method * @param array $args * @return mixed */ public function __call($method, array $args) { if (!$this->gasp) { throw new Exception('Must set a gasp instance before creating tasks.'); } $method = strtolower($method); $task = $this->factory($method, $args); $task->setGasp($this->gasp); if ('default' === $this->name) { $this->gasp->registerTaskInstance($method, $task); } else { $this->gasp->registerTaskInstance($this->name . '.' . $method, $task); } return $task; }