@@ -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 | |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | - * Copies files from the root of the build directory into the target folder |
|
| 48 | - */ |
|
| 47 | + * Copies files from the root of the build directory into the target folder |
|
| 48 | + */ |
|
| 49 | 49 | public function execute() |
| 50 | 50 | { |
| 51 | 51 | $build = $this->phpci->buildPath; |
@@ -39,8 +39,8 @@ |
||
| 39 | 39 | $this->phpci = $phpci; |
| 40 | 40 | $this->build = $build; |
| 41 | 41 | $this->directory = isset($options['directory']) ? $options['directory'] : $path; |
| 42 | - $this->wipe = isset($options['wipe']) ? (bool)$options['wipe'] : false; |
|
| 43 | - $this->ignore = isset($options['respect_ignore']) ? (bool)$options['respect_ignore'] : false; |
|
| 42 | + $this->wipe = isset($options['wipe']) ? (bool)$options['wipe'] : false; |
|
| 43 | + $this->ignore = isset($options['respect_ignore']) ? (bool)$options['respect_ignore'] : false; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | { |
| 81 | 81 | try { |
| 82 | 82 | $opts = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION); |
| 83 | - $pdo = new PDO('pgsql:host=' . $this->host, $this->user, $this->pass, $opts); |
|
| 83 | + $pdo = new PDO('pgsql:host='.$this->host, $this->user, $this->pass, $opts); |
|
| 84 | 84 | |
| 85 | 85 | foreach ($this->queries as $query) { |
| 86 | 86 | $pdo->query($this->phpci->interpolate($query)); |
@@ -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,8 +71,8 @@ discard block |
||
| 71 | 71 | $ignore = ''; |
| 72 | 72 | |
| 73 | 73 | if (count($this->phpci->ignore)) { |
| 74 | - $map = function ($item) { |
|
| 75 | - return ' --exclude ' . rtrim($item, DIRECTORY_SEPARATOR); |
|
| 74 | + $map = function($item) { |
|
| 75 | + return ' --exclude '.rtrim($item, DIRECTORY_SEPARATOR); |
|
| 76 | 76 | }; |
| 77 | 77 | |
| 78 | 78 | $ignore = array_map($map, $this->phpci->ignore); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $phploc = $this->phpci->findBinary('phploc'); |
| 83 | 83 | |
| 84 | - $success = $this->phpci->executeCommand($phploc . ' %s "%s"', $ignore, $this->directory); |
|
| 84 | + $success = $this->phpci->executeCommand($phploc.' %s "%s"', $ignore, $this->directory); |
|
| 85 | 85 | $output = $this->phpci->getLastOutput(); |
| 86 | 86 | |
| 87 | 87 | if (preg_match_all('/\((LOC|CLOC|NCLOC|LLOC)\)\s+([0-9]+)/', $output, $matches)) { |
@@ -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 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $content = ''; |
| 214 | 214 | $filename = $this->getStub(); |
| 215 | 215 | if ($filename) { |
| 216 | - $content = file_get_contents($this->getPHPCI()->buildPath . DIRECTORY_SEPARATOR . $this->getStub()); |
|
| 216 | + $content = file_get_contents($this->getPHPCI()->buildPath.DIRECTORY_SEPARATOR.$this->getStub()); |
|
| 217 | 217 | } |
| 218 | 218 | return $content; |
| 219 | 219 | } |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | $success = false; |
| 228 | 228 | |
| 229 | 229 | try { |
| 230 | - $file = $this->getDirectory() . DIRECTORY_SEPARATOR . $this->getFilename(); |
|
| 230 | + $file = $this->getDirectory().DIRECTORY_SEPARATOR.$this->getFilename(); |
|
| 231 | 231 | $phar = new PHPPhar($file, 0, $this->getFilename()); |
| 232 | 232 | $phar->buildFromDirectory($this->getPHPCI()->buildPath, $this->getRegExp()); |
| 233 | 233 | |
@@ -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 | |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | - * Runs PHP Spec tests. |
|
| 54 | - */ |
|
| 53 | + * Runs PHP Spec tests. |
|
| 54 | + */ |
|
| 55 | 55 | public function execute() |
| 56 | 56 | { |
| 57 | 57 | $curdir = getcwd(); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $phpspec = $this->phpci->findBinary(array('phpspec', 'phpspec.php')); |
| 61 | 61 | |
| 62 | - $success = $this->phpci->executeCommand($phpspec . ' --format=junit --no-code-generation run'); |
|
| 62 | + $success = $this->phpci->executeCommand($phpspec.' --format=junit --no-code-generation run'); |
|
| 63 | 63 | $output = $this->phpci->getLastOutput(); |
| 64 | 64 | |
| 65 | 65 | chdir($curdir); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | 'status' => (String)$attr['status'], |
| 116 | 116 | ); |
| 117 | 117 | |
| 118 | - if ($case['status']=='failed') { |
|
| 118 | + if ($case['status'] == 'failed') { |
|
| 119 | 119 | $error = array(); |
| 120 | 120 | /* |
| 121 | 121 | * ok, sad, we had an error |
@@ -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 | |
@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | - * Executes parallel lint |
|
| 74 | - */ |
|
| 73 | + * Executes parallel lint |
|
| 74 | + */ |
|
| 75 | 75 | public function execute() |
| 76 | 76 | { |
| 77 | 77 | list($ignore) = $this->getFlags(); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $phplint = $this->phpci->findBinary('parallel-lint'); |
| 80 | 80 | |
| 81 | - $cmd = $phplint . ' %s "%s"'; |
|
| 81 | + $cmd = $phplint.' %s "%s"'; |
|
| 82 | 82 | $success = $this->phpci->executeCommand( |
| 83 | 83 | $cmd, |
| 84 | 84 | $ignore, |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | $ignoreFlags = array(); |
| 105 | 105 | foreach ($this->ignore as $ignoreDir) { |
| 106 | - $ignoreFlags[] = '--exclude "' . $this->phpci->buildPath . $ignoreDir . '"'; |
|
| 106 | + $ignoreFlags[] = '--exclude "'.$this->phpci->buildPath.$ignoreDir.'"'; |
|
| 107 | 107 | } |
| 108 | 108 | $ignore = implode(' ', $ignoreFlags); |
| 109 | 109 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * Set working directory |
| 48 | 48 | */ |
| 49 | 49 | if (isset($options['directory'])) { |
| 50 | - $directory = $phpci->buildPath . DIRECTORY_SEPARATOR . $options['directory']; |
|
| 50 | + $directory = $phpci->buildPath.DIRECTORY_SEPARATOR.$options['directory']; |
|
| 51 | 51 | } else { |
| 52 | 52 | $directory = $phpci->buildPath; |
| 53 | 53 | } |
@@ -81,10 +81,10 @@ discard block |
||
| 81 | 81 | { |
| 82 | 82 | $phingExecutable = $this->phpci->findBinary('phing'); |
| 83 | 83 | |
| 84 | - $cmd[] = $phingExecutable . ' -f ' . $this->getBuildFilePath(); |
|
| 84 | + $cmd[] = $phingExecutable.' -f '.$this->getBuildFilePath(); |
|
| 85 | 85 | |
| 86 | 86 | if ($this->getPropertyFile()) { |
| 87 | - $cmd[] = '-propertyfile ' . $this->getPropertyFile(); |
|
| 87 | + $cmd[] = '-propertyfile '.$this->getPropertyFile(); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $cmd[] = $this->propertiesToString(); |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | public function setBuildFile($buildFile) |
| 181 | 181 | { |
| 182 | - if (!file_exists($this->getDirectory() . $buildFile)) { |
|
| 182 | + if (!file_exists($this->getDirectory().$buildFile)) { |
|
| 183 | 183 | throw new \Exception(Lang::get('build_file_missing')); |
| 184 | 184 | } |
| 185 | 185 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | public function getBuildFilePath() |
| 194 | 194 | { |
| 195 | - return $this->getDirectory() . $this->buildFile; |
|
| 195 | + return $this->getDirectory().$this->buildFile; |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | $propertiesString = array(); |
| 220 | 220 | |
| 221 | 221 | foreach ($this->properties as $name => $value) { |
| 222 | - $propertiesString[] = '-D' . $name . '="' . $value . '"'; |
|
| 222 | + $propertiesString[] = '-D'.$name.'="'.$value.'"'; |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | return implode(' ', $propertiesString); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | */ |
| 256 | 256 | public function setPropertyFile($propertyFile) |
| 257 | 257 | { |
| 258 | - if (!file_exists($this->getDirectory() . DIRECTORY_SEPARATOR . $propertyFile)) { |
|
| 258 | + if (!file_exists($this->getDirectory().DIRECTORY_SEPARATOR.$propertyFile)) { |
|
| 259 | 259 | throw new \Exception(Lang::get('property_file_missing')); |
| 260 | 260 | } |
| 261 | 261 | |
@@ -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\Plugin; |
| 11 | 11 | |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | - * Connects to MySQL and runs a specified set of queries. |
|
| 95 | - * @return boolean |
|
| 96 | - */ |
|
| 94 | + * Connects to MySQL and runs a specified set of queries. |
|
| 95 | + * @return boolean |
|
| 96 | + */ |
|
| 97 | 97 | public function execute() |
| 98 | 98 | { |
| 99 | 99 | try { |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $config = \b8\Database::getConnection('write')->getDetails(); |
| 69 | 69 | |
| 70 | - $this->host =(defined('PHPCI_DB_HOST')) ? PHPCI_DB_HOST : null; |
|
| 70 | + $this->host = (defined('PHPCI_DB_HOST')) ? PHPCI_DB_HOST : null; |
|
| 71 | 71 | $this->user = $config['user']; |
| 72 | 72 | $this->pass = $config['pass']; |
| 73 | 73 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | try { |
| 100 | 100 | $opts = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION); |
| 101 | - $pdo = new PDO('mysql:host=' . $this->host, $this->user, $this->pass, $opts); |
|
| 101 | + $pdo = new PDO('mysql:host='.$this->host, $this->user, $this->pass, $opts); |
|
| 102 | 102 | |
| 103 | 103 | foreach ($this->queries as $query) { |
| 104 | 104 | if (!is_array($query)) { |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | throw new \Exception(Lang::get('import_file_key')); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - $import_file = $this->phpci->buildPath . $this->phpci->interpolate($query['file']); |
|
| 132 | + $import_file = $this->phpci->buildPath.$this->phpci->interpolate($query['file']); |
|
| 133 | 133 | if (!is_readable($import_file)) { |
| 134 | 134 | throw new \Exception(Lang::get('cannot_open_import', $import_file)); |
| 135 | 135 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | ':host' => escapeshellarg($this->host), |
| 170 | 170 | ':user' => escapeshellarg($this->user), |
| 171 | 171 | ':pass' => escapeshellarg($this->pass), |
| 172 | - ':database' => ($database === null)? '': escapeshellarg($database), |
|
| 172 | + ':database' => ($database === null) ? '' : escapeshellarg($database), |
|
| 173 | 173 | ); |
| 174 | 174 | return strtr('cat :import_file :decomp_cmd | mysql -h:host -u:user -p:pass :database', $args); |
| 175 | 175 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | if ($item->isFile() && $item->getExtension() == 'php' && !$this->lintFile($php, $itemPath)) { |
| 95 | 95 | $success = false; |
| 96 | - } elseif ($item->isDir() && $this->recursive && !$this->lintDirectory($php, $itemPath . DIRECTORY_SEPARATOR)) { |
|
| 96 | + } elseif ($item->isDir() && $this->recursive && !$this->lintDirectory($php, $itemPath.DIRECTORY_SEPARATOR)) { |
|
| 97 | 97 | $success = false; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -109,14 +109,14 @@ discard block |
||
| 109 | 109 | protected function lintDirectory($php, $path) |
| 110 | 110 | { |
| 111 | 111 | $success = true; |
| 112 | - $directory = new \DirectoryIterator($this->phpci->buildPath . $path); |
|
| 112 | + $directory = new \DirectoryIterator($this->phpci->buildPath.$path); |
|
| 113 | 113 | |
| 114 | 114 | foreach ($directory as $item) { |
| 115 | 115 | if ($item->isDot()) { |
| 116 | 116 | continue; |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $itemPath = $path . $item->getFilename(); |
|
| 119 | + $itemPath = $path.$item->getFilename(); |
|
| 120 | 120 | |
| 121 | 121 | if (in_array($itemPath, $this->ignore)) { |
| 122 | 122 | continue; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | { |
| 141 | 141 | $success = true; |
| 142 | 142 | |
| 143 | - if (!$this->phpci->executeCommand($php . ' -l "%s"', $this->phpci->buildPath . $path)) { |
|
| 143 | + if (!$this->phpci->executeCommand($php.' -l "%s"', $this->phpci->buildPath.$path)) { |
|
| 144 | 144 | $this->phpci->logFailure($path); |
| 145 | 145 | $success = false; |
| 146 | 146 | } |
@@ -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 | |