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

@ -27,6 +27,9 @@ class SettingsController extends Controller
{
protected $settings;
/**
* Initialise the controller, set up stores and services.
*/
public function init()
{
parent::init();
@ -36,6 +39,10 @@ class SettingsController extends Controller
$this->settings = $parser->parse($yaml);
}
/**
* Display settings forms.
* @return string
*/
public function index()
{
$this->requireAdmin();
@ -65,6 +72,9 @@ class SettingsController extends Controller
return $this->view->render();
}
/**
* Save Github settings.
*/
public function github()
{
$this->requireAdmin();
@ -82,6 +92,9 @@ class SettingsController extends Controller
die;
}
/**
* Save email settings.
*/
public function email()
{
$this->requireAdmin();
@ -100,6 +113,9 @@ class SettingsController extends Controller
die;
}
/**
* Save build settings.
*/
public function build()
{
$this->requireAdmin();
@ -163,6 +179,10 @@ class SettingsController extends Controller
}
}
/**
* Get the Github settings form.
* @return Form
*/
protected function getGithubForm()
{
$form = new Form();
@ -202,6 +222,11 @@ class SettingsController extends Controller
return $form;
}
/**
* Get the email settings form.
* @param array $values
* @return Form
*/
protected function getEmailForm($values = array())
{
$form = new Form();
@ -272,6 +297,11 @@ class SettingsController extends Controller
return $form;
}
/**
* Call Github API for our Github user object.
* @param $token
* @return mixed
*/
protected function getGithubUser($token)
{
$http = new HttpClient('https://api.github.com');
@ -280,11 +310,20 @@ class SettingsController extends Controller
return $user['body'];
}
/**
* Check if we can write the PHPCI config file.
* @return bool
*/
protected function canWriteConfig()
{
return is_writeable(APPLICATION_PATH . 'PHPCI/config.yml');
}
/**
* Get the Build settings form.
* @param array $values
* @return Form
*/
protected function getBuildForm($values = array())
{
$form = new Form();