src/Rocketeer/Services/Builders/Modules/TasksBuilder.php
public function buildTaskFromClass($task)
    {
        if (is_object($task) && $task instanceof AbstractTask) {
            return $task;
        }

        // Cancel if class doesn't exist
        if (!$class = $this->taskClassExists($task)) {
            throw new TaskCompositionException($task);
        }

        // Build class
        $class = new $class();
        if ($class instanceof ContainerAwareInterface) {
            $class->setContainer($this->container);
        }

        return $class;
    }
public function buildTaskFromClass($task)
    {
        if (is_object($task) && $task instanceof AbstractTask) {
            return $task;
        }

        // Cancel if class doesn't exist
        if (!$class = $this->taskClassExists($task)) {
            throw new TaskCompositionException($task);
        }

        // Build class
        $class = new $class();
        if ($class instanceof ContainerAwareInterface) {
            $class->setContainer($this->container);
        }

        return $class;
    }
public function buildTaskFromClass ( $ task ) { if ( is_object ( $ task ) && $ task instanceof AbstractTask ) { return $ task ; } // Cancel if class doesn't exist if ( ! $ class = $ this -> taskClassExists ( $ task ) ) { throw new TaskCompositionException ( $ task ) ; } // Build class $ class = new $ class ( ) ; if ( $ class instanceof ContainerAwareInterface ) { $ class -> setContainer ( $ this -> container ) ; } return $ class ; }
Build a task from its name.

@param string|\Rocketeer\Tasks\AbstractTask $task

@throws TaskCompositionException

@return AbstractTask
Build a task from its name .