@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function getById($value, $useConnection = 'read') |
| 36 | 36 | { |
| 37 | 37 | if (is_null($value)) { |
| 38 | - throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.'); |
|
| 38 | + throw new HttpException('Value passed to '.__FUNCTION__.' cannot be null.'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $query = 'SELECT * FROM `build_error` WHERE `id` = :id LIMIT 1'; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function getByBuildId($value, $limit = 1000, $useConnection = 'read') |
| 59 | 59 | { |
| 60 | 60 | if (is_null($value)) { |
| 61 | - throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.'); |
|
| 61 | + throw new HttpException('Value passed to '.__FUNCTION__.' cannot be null.'); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | if ($stmt->execute()) { |
| 71 | 71 | $res = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
| 72 | 72 | |
| 73 | - $map = function ($item) { |
|
| 73 | + $map = function($item) { |
|
| 74 | 74 | return new BuildError($item); |
| 75 | 75 | }; |
| 76 | 76 | $rtn = array_map($map, $res); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function getById($value, $useConnection = 'read') |
| 36 | 36 | { |
| 37 | 37 | if (is_null($value)) { |
| 38 | - throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.'); |
|
| 38 | + throw new HttpException('Value passed to '.__FUNCTION__.' cannot be null.'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $query = 'SELECT * FROM `project` WHERE `id` = :id LIMIT 1'; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function getByTitle($value, $limit = 1000, $useConnection = 'read') |
| 59 | 59 | { |
| 60 | 60 | if (is_null($value)) { |
| 61 | - throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.'); |
|
| 61 | + throw new HttpException('Value passed to '.__FUNCTION__.' cannot be null.'); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | if ($stmt->execute()) { |
| 71 | 71 | $res = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
| 72 | 72 | |
| 73 | - $map = function ($item) { |
|
| 73 | + $map = function($item) { |
|
| 74 | 74 | return new Project($item); |
| 75 | 75 | }; |
| 76 | 76 | $rtn = array_map($map, $res); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | public function getByGroupId($value, $limit = 1000, $useConnection = 'read') |
| 91 | 91 | { |
| 92 | 92 | if (is_null($value)) { |
| 93 | - throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.'); |
|
| 93 | + throw new HttpException('Value passed to '.__FUNCTION__.' cannot be null.'); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | if ($stmt->execute()) { |
| 103 | 103 | $res = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
| 104 | 104 | |
| 105 | - $map = function ($item) { |
|
| 105 | + $map = function($item) { |
|
| 106 | 106 | return new Project($item); |
| 107 | 107 | }; |
| 108 | 108 | $rtn = array_map($map, $res); |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | public function getById($value, $useConnection = 'read') |
| 36 | 36 | { |
| 37 | 37 | if (is_null($value)) { |
| 38 | - throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.'); |
|
| 38 | + throw new HttpException('Value passed to '.__FUNCTION__.' cannot be null.'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $query = 'SELECT * FROM `project_group` WHERE `id` = :id LIMIT 1'; |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function getById($value, $useConnection = 'read') |
| 36 | 36 | { |
| 37 | 37 | if (is_null($value)) { |
| 38 | - throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.'); |
|
| 38 | + throw new HttpException('Value passed to '.__FUNCTION__.' cannot be null.'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | $query = 'SELECT * FROM `user` WHERE `id` = :id LIMIT 1'; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function getByEmail($value, $useConnection = 'read') |
| 59 | 59 | { |
| 60 | 60 | if (is_null($value)) { |
| 61 | - throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.'); |
|
| 61 | + throw new HttpException('Value passed to '.__FUNCTION__.' cannot be null.'); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | $query = 'SELECT * FROM `user` WHERE `email` = :email LIMIT 1'; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public function getByName($value, $limit = 1000, $useConnection = 'read') |
| 82 | 82 | { |
| 83 | 83 | if (is_null($value)) { |
| 84 | - throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.'); |
|
| 84 | + throw new HttpException('Value passed to '.__FUNCTION__.' cannot be null.'); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | if ($stmt->execute()) { |
| 94 | 94 | $res = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
| 95 | 95 | |
| 96 | - $map = function ($item) { |
|
| 96 | + $map = function($item) { |
|
| 97 | 97 | return new User($item); |
| 98 | 98 | }; |
| 99 | 99 | $rtn = array_map($map, $res); |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | if ($stmt->execute()) { |
| 39 | 39 | $res = $stmt->fetchAll(\PDO::FETCH_ASSOC); |
| 40 | 40 | |
| 41 | - $map = function ($item) { |
|
| 41 | + $map = function($item) { |
|
| 42 | 42 | return new BuildMeta($item); |
| 43 | 43 | }; |
| 44 | 44 | $rtn = array_map($map, $res); |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCI - Continuous Integration for PHP |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | - * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | - * @link https://www.phptesting.org/ |
|
| 8 | - */ |
|
| 3 | + * PHPCI - Continuous Integration for PHP |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | + * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | + * @link https://www.phptesting.org/ |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | namespace PHPCI\Service; |
| 11 | 11 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | try { |
| 124 | 124 | $build = BuildFactory::getBuildById($jobData['build_id']); |
| 125 | 125 | } catch (\Exception $ex) { |
| 126 | - $this->logger->addWarning('Build #' . $jobData['build_id'] . ' does not exist in the database.'); |
|
| 126 | + $this->logger->addWarning('Build #'.$jobData['build_id'].' does not exist in the database.'); |
|
| 127 | 127 | $this->pheanstalk->delete($job); |
| 128 | 128 | } |
| 129 | 129 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | } catch (\Exception $ex) { |
| 148 | 148 | $build->setStatus(Build::STATUS_FAILED); |
| 149 | 149 | $build->setFinished(new \DateTime()); |
| 150 | - $build->setLog($build->getLog() . PHP_EOL . PHP_EOL . $ex->getMessage()); |
|
| 150 | + $build->setLog($build->getLog().PHP_EOL.PHP_EOL.$ex->getMessage()); |
|
| 151 | 151 | $buildStore->save($build); |
| 152 | 152 | $build->sendStatusPostback(); |
| 153 | 153 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function handleError($level, $message, $file, $line) |
| 54 | 54 | { |
| 55 | - if (error_reporting() & $level === 0) { |
|
| 55 | + if (error_reporting()&$level === 0) { |
|
| 56 | 56 | return; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCI - Continuous Integration for PHP |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | - * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | - * @link https://www.phptesting.org/ |
|
| 8 | - */ |
|
| 3 | + * PHPCI - Continuous Integration for PHP |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | + * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | + * @link https://www.phptesting.org/ |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | namespace PHPCI\Service; |
| 11 | 11 | |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCI - Continuous Integration for PHP |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | - * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | - * @link https://www.phptesting.org/ |
|
| 8 | - */ |
|
| 3 | + * PHPCI - Continuous Integration for PHP |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | + * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | + * @link https://www.phptesting.org/ |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | namespace PHPCI\Controller; |
| 11 | 11 | |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * Display PHPCI dashboard: |
|
| 52 | - */ |
|
| 51 | + * Display PHPCI dashboard: |
|
| 52 | + */ |
|
| 53 | 53 | public function index() |
| 54 | 54 | { |
| 55 | 55 | $this->layout->title = Lang::get('dashboard'); |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | - * AJAX get latest builds table (HTML) |
|
| 70 | - */ |
|
| 69 | + * AJAX get latest builds table (HTML) |
|
| 70 | + */ |
|
| 71 | 71 | public function latest() |
| 72 | 72 | { |
| 73 | 73 | $this->response->disableLayout(); |
@@ -128,8 +128,8 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
| 131 | - * Get latest builds and render as a table. |
|
| 132 | - */ |
|
| 131 | + * Get latest builds and render as a table. |
|
| 132 | + */ |
|
| 133 | 133 | protected function getLatestBuildsHtml() |
| 134 | 134 | { |
| 135 | 135 | $builds = $this->buildStore->getWhere(array(), 5, 0, array(), array('id' => 'DESC')); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $this->buildStore = b8\Store\Factory::getStore('Build'); |
| 46 | 46 | $this->projectStore = b8\Store\Factory::getStore('Project'); |
| 47 | - $this->groupStore = b8\Store\Factory::getStore('ProjectGroup'); |
|
| 47 | + $this->groupStore = b8\Store\Factory::getStore('ProjectGroup'); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $build = BuildFactory::getBuild($build); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - $this->view->builds = $builds; |
|
| 62 | + $this->view->builds = $builds; |
|
| 63 | 63 | $this->view->groups = $this->getGroupInfo(); |
| 64 | 64 | |
| 65 | 65 | return $this->view->render(); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $build = BuildFactory::getBuild($build); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - $view->builds = $builds['items']; |
|
| 142 | + $view->builds = $builds['items']; |
|
| 143 | 143 | |
| 144 | 144 | return $view->render(); |
| 145 | 145 | } |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPCI - Continuous Integration for PHP |
|
| 4 | - * |
|
| 5 | - * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | - * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | - * @link https://www.phptesting.org/ |
|
| 8 | - */ |
|
| 3 | + * PHPCI - Continuous Integration for PHP |
|
| 4 | + * |
|
| 5 | + * @copyright Copyright 2014, Block 8 Limited. |
|
| 6 | + * @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md |
|
| 7 | + * @link https://www.phptesting.org/ |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | namespace PHPCI\Controller; |
| 11 | 11 | |
@@ -127,8 +127,8 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | - * Returns the appropriate build status image in SVG format for a given project. |
|
| 131 | - */ |
|
| 130 | + * Returns the appropriate build status image in SVG format for a given project. |
|
| 131 | + */ |
|
| 132 | 132 | public function image($projectId) |
| 133 | 133 | { |
| 134 | 134 | $style = $this->getParam('style', 'plastic'); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | if (isset($project) && $project instanceof Project) { |
| 60 | - $build = $project->getLatestBuild($branch, array(2,3)); |
|
| 60 | + $build = $project->getLatestBuild($branch, array(2, 3)); |
|
| 61 | 61 | |
| 62 | 62 | if (isset($build) && $build instanceof Build && $build->getStatus() != 2) { |
| 63 | 63 | $status = 'failed'; |
@@ -168,11 +168,11 @@ discard block |
||
| 168 | 168 | $project = $this->projectStore->getById($projectId); |
| 169 | 169 | |
| 170 | 170 | if (empty($project)) { |
| 171 | - throw new NotFoundException('Project with id: ' . $projectId . ' not found'); |
|
| 171 | + throw new NotFoundException('Project with id: '.$projectId.' not found'); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | if (!$project->getAllowPublicStatus()) { |
| 175 | - throw new NotFoundException('Project with id: ' . $projectId . ' not found'); |
|
| 175 | + throw new NotFoundException('Project with id: '.$projectId.' not found'); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | $builds = $this->getLatestBuilds($projectId); |