src/Rocketeer/Services/Builders/Modules/TasksBuilder.php
public function buildTask($task, $name = null, $description = null)
    {
        // Compose the task from their various types
        $task = $this->composeTask($task);

        // If the built class is invalid, cancel
        if (!$task instanceof AbstractTask) {
            throw new TaskCompositionException($task);
        }

        // Set task properties
        $task->setName($name);
        $task->setDescription($description);
        $task = $this->modulable->registerBashModulesOn($task);

        // Bind instance for later user
        if (!$task instanceof ClosureTask) {
            $this->container->add('rocketeer.'.$task->getIdentifier(), $task);
        }

        return $task;
    }
public function buildTask($task, $name = null, $description = null)
    {
        // Compose the task from their various types
        $task = $this->composeTask($task);

        // If the built class is invalid, cancel
        if (!$task instanceof AbstractTask) {
            throw new TaskCompositionException($task);
        }

        // Set task properties
        $task->setName($name);
        $task->setDescription($description);
        $task = $this->modulable->registerBashModulesOn($task);

        // Bind instance for later user
        if (!$task instanceof ClosureTask) {
            $this->container->add('rocketeer.'.$task->getIdentifier(), $task);
        }

        return $task;
    }
public function buildTask ( $ task , $ name = null , $ description = null ) { // Compose the task from their various types $ task = $ this -> composeTask ( $ task ) ; // If the built class is invalid, cancel if ( ! $ task instanceof AbstractTask ) { throw new TaskCompositionException ( $ task ) ; } // Set task properties $ task -> setName ( $ name ) ; $ task -> setDescription ( $ description ) ; $ task = $ this -> modulable -> registerBashModulesOn ( $ task ) ; // Bind instance for later user if ( ! $ task instanceof ClosureTask ) { $ this -> container -> add ( 'rocketeer.' . $ task -> getIdentifier ( ) , $ task ) ; } return $ task ; }
Build a task from anything.

@param string|Closure|\Rocketeer\Tasks\AbstractTask $task
@param string|null                                  $name
@param string|null                                  $description

@throws \Rocketeer\Services\Builders\TaskCompositionException

@return AbstractTask
Build a task from anything .