Code style fixes

This commit is contained in:
Dmitry Khomutov 2016-04-20 21:39:48 +06:00
commit 0868eb9c69
63 changed files with 1413 additions and 1494 deletions

View file

@ -138,13 +138,13 @@ class Build extends BuildBase
$pluginDir = PHPCI_DIR . 'PHPCI/Plugin/';
$dir = new \DirectoryIterator($pluginDir);
$config = array(
'build_settings' => array(
'ignore' => array(
$config = [
'build_settings' => [
'ignore' => [
'vendor',
)
)
);
]
]
];
foreach ($dir as $item) {
if ($item->isDot()) {
@ -167,11 +167,11 @@ class Build extends BuildBase
continue;
}
foreach (array('setup', 'test', 'complete', 'success', 'failure') as $stage) {
foreach (['setup', 'test', 'complete', 'success', 'failure'] as $stage) {
if ($className::canExecute($stage, $builder, $this)) {
$config[$stage][$className] = array(
$config[$stage][$className] = [
'zero_config' => true
);
];
}
}
}

View file

@ -30,14 +30,14 @@ class Project extends ProjectBase
*/
public function getLatestBuild($branch = 'master', $status = null)
{
$criteria = array('branch' => $branch, 'project_id' => $this->getId());
$criteria = ['branch' => $branch, 'project_id' => $this->getId()];
if (isset($status)) {
$criteria['status'] = $status;
}
$order = array('id' => 'DESC');
$builds = Store\Factory::getStore('Build')->getWhere($criteria, 1, 0, array(), $order);
$order = ['id' => 'DESC'];
$builds = Store\Factory::getStore('Build')->getWhere($criteria, 1, 0, [], $order);
if (is_array($builds['items']) && count($builds['items'])) {
$latest = array_shift($builds['items']);
@ -57,10 +57,9 @@ class Project extends ProjectBase
*/
public function getPreviousBuild($branch = 'master')
{
$criteria = array('branch' => $branch, 'project_id' => $this->getId());
$order = array('id' => 'DESC');
$builds = Store\Factory::getStore('Build')->getWhere($criteria, 1, 1, array(), $order);
$criteria = ['branch' => $branch, 'project_id' => $this->getId()];
$order = ['id' => 'DESC'];
$builds = Store\Factory::getStore('Build')->getWhere($criteria, 1, 1, [], $order);
if (is_array($builds['items']) && count($builds['items'])) {
$previous = array_shift($builds['items']);