From d7db91382420ca6a098e0c1c4ab18aad53afd356 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Thu, 8 Dec 2016 16:46:40 +1300 Subject: [PATCH] Add doc blocks for the $request given to BuildTasks Allows BuildTask developers to know what the $request is, and outline BuildTask instances. --- dev/BuildTask.php | 7 +++++-- dev/TaskRunner.php | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dev/BuildTask.php b/dev/BuildTask.php index 0ac0d5d7c..c374b45a5 100644 --- a/dev/BuildTask.php +++ b/dev/BuildTask.php @@ -33,9 +33,14 @@ abstract class BuildTask extends Object { /** * Implement this method in the task subclass to * execute via the TaskRunner + * + * @param SS_HTTPRequest $request */ abstract public function run($request); + /** + * @return bool + */ public function isEnabled() { return $this->enabled; } @@ -55,5 +60,3 @@ abstract class BuildTask extends Object { } } - - diff --git a/dev/TaskRunner.php b/dev/TaskRunner.php index 0c7bba1dd..c09a72d73 100644 --- a/dev/TaskRunner.php +++ b/dev/TaskRunner.php @@ -59,6 +59,10 @@ class TaskRunner extends Controller { } } + /** + * Runs a BuildTask + * @param SS_HTTPRequest $request + */ public function runTask($request) { $name = $request->param('TaskName'); $tasks = $this->getTasks(); @@ -73,7 +77,7 @@ class TaskRunner extends Controller { foreach ($tasks as $task) { if ($task['segment'] == $name) { - $inst = Injector::inst()->create($task['class']); + $inst = Injector::inst()->create($task['class']); /** @var BuildTask $inst */ $title(sprintf('Running Task %s', $inst->getTitle())); if (!$inst->isEnabled()) {