src/Rocketeer/Services/Builders/Modules/TasksBuilder.php
public function buildTaskFromClosure($callback, $stringTask = null)
    {
        /** @var ClosureTask $task */
        $task = $this->buildTaskFromClass(ClosureTask::class);
        $task->setClosure($callback);

        // If we had an original string used, store it on
        // the task for easier reflection
        if ($stringTask) {
            $task->setStringTask($stringTask);
        }

        return $task;
    }
public function buildTaskFromClosure($callback, $stringTask = null)
    {
        /** @var ClosureTask $task */
        $task = $this->buildTaskFromClass(ClosureTask::class);
        $task->setClosure($callback);

        // If we had an original string used, store it on
        // the task for easier reflection
        if ($stringTask) {
            $task->setStringTask($stringTask);
        }

        return $task;
    }
public function buildTaskFromClosure ( $ callback , $ stringTask = null ) { /** @var ClosureTask $task */ $ task = $ this -> buildTaskFromClass ( ClosureTask :: class ) ; $ task -> setClosure ( $ callback ) ; // If we had an original string used, store it on // the task for easier reflection if ( $ stringTask ) { $ task -> setStringTask ( $ stringTask ) ; } return $ task ; }
Build a task from a Closure or a string command.

@param SerializableClosure|Closure $callback
@param string|null                 $stringTask

@return \Rocketeer\Tasks\AbstractTask
Build a task from a Closure or a string command .