Adding Docblocks throughout the project and lowering the missing docblock limit in phpci.yml to zero.

Closes #692
This commit is contained in:
Dan Cryer 2014-12-08 11:25:33 +00:00
commit 7f9a09fa29
83 changed files with 1283 additions and 69 deletions

View file

@ -14,6 +14,10 @@ use b8\Http\Request;
use b8\Http\Response;
use b8\View;
/**
* PHPCI Base Controller
* @package PHPCI
*/
class Controller extends \b8\Controller
{
/**
@ -26,11 +30,19 @@ class Controller extends \b8\Controller
*/
protected $view;
/**
* Initialise the controller.
*/
public function init()
{
// Extended by actual controllers.
}
/**
* @param Config $config
* @param Request $request
* @param Response $response
*/
public function __construct(Config $config, Request $request, Response $response)
{
parent::__construct($config, $request, $response);
@ -40,6 +52,9 @@ class Controller extends \b8\Controller
$this->setControllerView();
}
/**
* Set the view that this controller should use.
*/
protected function setControllerView()
{
if (View::exists($this->className)) {
@ -49,6 +64,10 @@ class Controller extends \b8\Controller
}
}
/**
* Set the view that this controller action should use.
* @param $action
*/
protected function setView($action)
{
if (View::exists($this->className . '/' . $action)) {
@ -56,6 +75,12 @@ class Controller extends \b8\Controller
}
}
/**
* Handle the incoming request.
* @param $action
* @param $actionParams
* @return \b8\b8\Http\Response|Response
*/
public function handleAction($action, $actionParams)
{
$this->setView($action);