@@ -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\Plugin; |
| 11 | 11 | |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | - * Adds the specified environment variables to the builder environment |
|
| 43 | - */ |
|
| 42 | + * Adds the specified environment variables to the builder environment |
|
| 43 | + */ |
|
| 44 | 44 | public function execute() |
| 45 | 45 | { |
| 46 | 46 | $success = true; |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | foreach ($this->env_vars as $key => $value) { |
| 48 | 48 | if (is_numeric($key)) { |
| 49 | 49 | // This allows the developer to specify env vars like " - FOO=bar" or " - FOO: bar" |
| 50 | - $env_var = is_array($value)? key($value).'='.current($value): $value; |
|
| 50 | + $env_var = is_array($value) ? key($value).'='.current($value) : $value; |
|
| 51 | 51 | } else { |
| 52 | 52 | // This allows the standard syntax: "FOO: bar" |
| 53 | 53 | $env_var = "$key=$value"; |
@@ -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\Plugin; |
| 11 | 11 | |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | - * Send notification message. |
|
| 149 | - */ |
|
| 148 | + * Send notification message. |
|
| 149 | + */ |
|
| 150 | 150 | public function execute() |
| 151 | 151 | { |
| 152 | 152 | $sendxmpp = $this->phpci->findBinary('sendxmpp'); |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | public function findConfigFile() |
| 134 | 134 | { |
| 135 | - if (file_exists($this->phpci->buildPath . DIRECTORY_SEPARATOR . '.sendxmpprc')) { |
|
| 136 | - if (md5(file_get_contents($this->phpci->buildPath . DIRECTORY_SEPARATOR . '.sendxmpprc')) |
|
| 135 | + if (file_exists($this->phpci->buildPath.DIRECTORY_SEPARATOR.'.sendxmpprc')) { |
|
| 136 | + if (md5(file_get_contents($this->phpci->buildPath.DIRECTORY_SEPARATOR.'.sendxmpprc')) |
|
| 137 | 137 | !== md5($this->getConfigFormat())) { |
| 138 | 138 | return null; |
| 139 | 139 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | /* |
| 162 | 162 | * Try to build conf file |
| 163 | 163 | */ |
| 164 | - $config_file = $this->phpci->buildPath . DIRECTORY_SEPARATOR . '.sendxmpprc'; |
|
| 164 | + $config_file = $this->phpci->buildPath.DIRECTORY_SEPARATOR.'.sendxmpprc'; |
|
| 165 | 165 | if (is_null($this->findConfigFile())) { |
| 166 | 166 | file_put_contents($config_file, $this->getConfigFormat()); |
| 167 | 167 | chmod($config_file, 0600); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | $tls = ' -t'; |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - $message_file = $this->phpci->buildPath . DIRECTORY_SEPARATOR . uniqid('xmppmessage'); |
|
| 178 | + $message_file = $this->phpci->buildPath.DIRECTORY_SEPARATOR.uniqid('xmppmessage'); |
|
| 179 | 179 | if ($this->buildMessage($message_file) === false) { |
| 180 | 180 | return false; |
| 181 | 181 | } |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | /* |
| 184 | 184 | * Send XMPP notification for all recipients |
| 185 | 185 | */ |
| 186 | - $cmd = $sendxmpp . "%s -f %s -m %s %s"; |
|
| 186 | + $cmd = $sendxmpp."%s -f %s -m %s %s"; |
|
| 187 | 187 | $recipients = implode(' ', $this->recipients); |
| 188 | 188 | |
| 189 | 189 | $success = $this->phpci->executeCommand($cmd, $tls, $config_file, $message_file, $recipients); |
@@ -205,9 +205,9 @@ discard block |
||
| 205 | 205 | protected function buildMessage($message_file) |
| 206 | 206 | { |
| 207 | 207 | if ($this->build->isSuccessful()) { |
| 208 | - $message = "✔ [".$this->build->getProjectTitle()."] Build #" . $this->build->getId()." successful"; |
|
| 208 | + $message = "✔ [".$this->build->getProjectTitle()."] Build #".$this->build->getId()." successful"; |
|
| 209 | 209 | } else { |
| 210 | - $message = "✘ [".$this->build->getProjectTitle()."] Build #" . $this->build->getId()." failure"; |
|
| 210 | + $message = "✘ [".$this->build->getProjectTitle()."] Build #".$this->build->getId()." failure"; |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | $message .= ' ('.strftime($this->date_format).')'; |
@@ -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\Plugin; |
| 11 | 11 | |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | - * Executes Composer and runs a specified command (e.g. install / update) |
|
| 46 | - */ |
|
| 45 | + * Executes Composer and runs a specified command (e.g. install / update) |
|
| 46 | + */ |
|
| 47 | 47 | public function execute() |
| 48 | 48 | { |
| 49 | 49 | $path = $this->phpci->buildPath; |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | $this->phpci = $phpci; |
| 39 | 39 | $this->directory = isset($options['directory']) ? $options['directory'] : $path; |
| 40 | 40 | $this->filename = isset($options['filename']) ? $options['filename'] : 'build'; |
| 41 | - $this->format = isset($options['format']) ? $options['format'] : 'zip'; |
|
| 41 | + $this->format = isset($options['format']) ? $options['format'] : 'zip'; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | if (!$this->lintFile($itemPath)) { |
| 156 | 156 | $success = false; |
| 157 | 157 | } |
| 158 | - } elseif ($item->isDir() && $this->recursive && !$this->lintDirectory($itemPath . DIRECTORY_SEPARATOR)) { |
|
| 158 | + } elseif ($item->isDir() && $this->recursive && !$this->lintDirectory($itemPath.DIRECTORY_SEPARATOR)) { |
|
| 159 | 159 | $success = false; |
| 160 | 160 | } |
| 161 | 161 | |
@@ -170,14 +170,14 @@ discard block |
||
| 170 | 170 | protected function lintDirectory($path) |
| 171 | 171 | { |
| 172 | 172 | $success = true; |
| 173 | - $directory = new \DirectoryIterator($this->phpci->buildPath . $path); |
|
| 173 | + $directory = new \DirectoryIterator($this->phpci->buildPath.$path); |
|
| 174 | 174 | |
| 175 | 175 | foreach ($directory as $item) { |
| 176 | 176 | if ($item->isDot()) { |
| 177 | 177 | continue; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $itemPath = $path . $item->getFilename(); |
|
| 180 | + $itemPath = $path.$item->getFilename(); |
|
| 181 | 181 | |
| 182 | 182 | if (in_array($itemPath, $this->ignore)) { |
| 183 | 183 | continue; |
@@ -202,12 +202,12 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | list($suffixes, $tales) = $this->getFlags(); |
| 204 | 204 | |
| 205 | - $lint = dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR; |
|
| 206 | - $lint .= 'vendor' . DIRECTORY_SEPARATOR . 'phptal' . DIRECTORY_SEPARATOR . 'phptal' . DIRECTORY_SEPARATOR; |
|
| 207 | - $lint .= 'tools' . DIRECTORY_SEPARATOR . 'phptal_lint.php'; |
|
| 208 | - $cmd = '/usr/bin/env php ' . $lint . ' %s %s "%s"'; |
|
| 205 | + $lint = dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR; |
|
| 206 | + $lint .= 'vendor'.DIRECTORY_SEPARATOR.'phptal'.DIRECTORY_SEPARATOR.'phptal'.DIRECTORY_SEPARATOR; |
|
| 207 | + $lint .= 'tools'.DIRECTORY_SEPARATOR.'phptal_lint.php'; |
|
| 208 | + $cmd = '/usr/bin/env php '.$lint.' %s %s "%s"'; |
|
| 209 | 209 | |
| 210 | - $this->phpci->executeCommand($cmd, $suffixes, $tales, $this->phpci->buildPath . $path); |
|
| 210 | + $this->phpci->executeCommand($cmd, $suffixes, $tales, $this->phpci->buildPath.$path); |
|
| 211 | 211 | |
| 212 | 212 | $output = $this->phpci->getLastOutput(); |
| 213 | 213 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $name = basename($path); |
| 224 | 224 | |
| 225 | 225 | $row = str_replace('(use -i to include your custom modifier functions)', '', $row); |
| 226 | - $message = str_replace($name . ': ', '', $row); |
|
| 226 | + $message = str_replace($name.': ', '', $row); |
|
| 227 | 227 | |
| 228 | 228 | $parts = explode(' (line ', $message); |
| 229 | 229 | |
@@ -252,12 +252,12 @@ discard block |
||
| 252 | 252 | { |
| 253 | 253 | $tales = ''; |
| 254 | 254 | if (!empty($this->tales)) { |
| 255 | - $tales = ' -i ' . $this->phpci->buildPath . $this->tales; |
|
| 255 | + $tales = ' -i '.$this->phpci->buildPath.$this->tales; |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | $suffixes = ''; |
| 259 | 259 | if (count($this->suffixes)) { |
| 260 | - $suffixes = ' -e ' . implode(',', $this->suffixes); |
|
| 260 | + $suffixes = ' -e '.implode(',', $this->suffixes); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | return array($suffixes, $tales); |
@@ -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 | |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | return false; |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - $success = $this->phpci->executeCommand($behat . ' %s', $this->features); |
|
| 74 | + $success = $this->phpci->executeCommand($behat.' %s', $this->features); |
|
| 75 | 75 | chdir($curdir); |
| 76 | 76 | |
| 77 | 77 | list($errorCount, $data) = $this->parseBehatOutput(); |
@@ -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 | |
@@ -31,12 +31,12 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function init() |
| 33 | 33 | { |
| 34 | - $request =& $this->request; |
|
| 34 | + $request = & $this->request; |
|
| 35 | 35 | $route = '/:controller/:action'; |
| 36 | 36 | $opts = array('controller' => 'Home', 'action' => 'index'); |
| 37 | 37 | |
| 38 | 38 | // Inlined as a closure to fix "using $this when not in object context" on 5.3 |
| 39 | - $validateSession = function () { |
|
| 39 | + $validateSession = function() { |
|
| 40 | 40 | if (!empty($_SESSION['phpci_user_id'])) { |
| 41 | 41 | $user = b8\Store\Factory::getStore('User')->getByPrimaryKey($_SESSION['phpci_user_id']); |
| 42 | 42 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $skipAuth = array($this, 'shouldSkipAuth'); |
| 55 | 55 | |
| 56 | 56 | // Handler for the route we're about to register, checks for a valid session where necessary: |
| 57 | - $routeHandler = function (&$route, Response &$response) use (&$request, $validateSession, $skipAuth) { |
|
| 57 | + $routeHandler = function(&$route, Response&$response) use (&$request, $validateSession, $skipAuth) { |
|
| 58 | 58 | $skipValidation = in_array($route['controller'], array('session', 'webhook', 'build-status')); |
| 59 | 59 | |
| 60 | 60 | if (!$skipValidation && !$validateSession() && (!is_callable($skipAuth) || !$skipAuth())) { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | if ($this->response->hasLayout() && $this->controller->layout) { |
| 108 | 108 | $this->setLayoutVariables($this->controller->layout); |
| 109 | 109 | |
| 110 | - $this->controller->layout->content = $this->response->getContent(); |
|
| 110 | + $this->controller->layout->content = $this->response->getContent(); |
|
| 111 | 111 | $this->response->setContent($this->controller->layout->render()); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * Injects variables into the layout before rendering it. |
| 134 | 134 | * @param View $layout |
| 135 | 135 | */ |
| 136 | - protected function setLayoutVariables(View &$layout) |
|
| 136 | + protected function setLayoutVariables(View&$layout) |
|
| 137 | 137 | { |
| 138 | 138 | $groups = array(); |
| 139 | 139 | $groupStore = b8\Store\Factory::getStore('ProjectGroup'); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | { |
| 158 | 158 | $config = b8\Config::getInstance(); |
| 159 | 159 | $state = (bool)$config->get('phpci.authentication_settings.state', false); |
| 160 | - $userId = $config->get('phpci.authentication_settings.user_id', 0); |
|
| 160 | + $userId = $config->get('phpci.authentication_settings.user_id', 0); |
|
| 161 | 161 | |
| 162 | 162 | if (false !== $state && 0 != (int)$userId) { |
| 163 | 163 | $user = b8\Store\Factory::getStore('User') |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | try { |
| 86 | 86 | $buildCount = $runner->run($emptyInput, $output); |
| 87 | 87 | } catch (\Exception $e) { |
| 88 | - $output->writeln('<error>Exception: ' . $e->getMessage() . '</error>'); |
|
| 89 | - $output->writeln('<error>Line: ' . $e->getLine() . ' - File: ' . $e->getFile() . '</error>'); |
|
| 88 | + $output->writeln('<error>Exception: '.$e->getMessage().'</error>'); |
|
| 89 | + $output->writeln('<error>Line: '.$e->getLine().' - File: '.$e->getFile().'</error>'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | if (0 == $buildCount && $this->sleep < 15) { |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | } elseif (1 < $this->sleep) { |
| 95 | 95 | $this->sleep--; |
| 96 | 96 | } |
| 97 | - echo '.'.(0 === $buildCount?'':'build'); |
|
| 97 | + echo '.'.(0 === $buildCount ? '' : 'build'); |
|
| 98 | 98 | sleep($this->sleep); |
| 99 | 99 | } |
| 100 | 100 | } |
@@ -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\Command; |
| 11 | 11 | |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
| 66 | - * Loops through running. |
|
| 67 | - */ |
|
| 66 | + * Loops through running. |
|
| 67 | + */ |
|
| 68 | 68 | protected function execute(InputInterface $input, OutputInterface $output) |
| 69 | 69 | { |
| 70 | 70 | $runner = new RunCommand($this->logger); |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | /** |
| 86 | - * Called when log entries are made in Builder / the plugins. |
|
| 87 | - * @see \PHPCI\Builder::log() |
|
| 88 | - */ |
|
| 86 | + * Called when log entries are made in Builder / the plugins. |
|
| 87 | + * @see \PHPCI\Builder::log() |
|
| 88 | + */ |
|
| 89 | 89 | public function logCallback($log) |
| 90 | 90 | { |
| 91 | 91 | $this->output->writeln($log); |
@@ -192,7 +192,7 @@ |
||
| 192 | 192 | |
| 193 | 193 | $pid = intval(trim(file_get_contents($this->pidFilePath))); |
| 194 | 194 | |
| 195 | - if($this->processControl->isRunning($pid, true)) { |
|
| 195 | + if ($this->processControl->isRunning($pid, true)) { |
|
| 196 | 196 | return $pid; |
| 197 | 197 | } |
| 198 | 198 | |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | $output->write(Lang::get('updating_phpci')); |
| 55 | 55 | |
| 56 | - shell_exec(PHPCI_DIR . 'vendor/bin/phinx migrate -c "' . PHPCI_DIR . 'phinx.php"'); |
|
| 56 | + shell_exec(PHPCI_DIR.'vendor/bin/phinx migrate -c "'.PHPCI_DIR.'phinx.php"'); |
|
| 57 | 57 | |
| 58 | 58 | $output->writeln('<info>'.Lang::get('ok').'</info>'); |
| 59 | 59 | } |
@@ -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 | |