@@ -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 | } |
@@ -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\Plugin; |
| 11 | 11 | |
@@ -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\Plugin; |
| 11 | 11 | |
@@ -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 @@ 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 | |
@@ -69,8 +69,8 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | - * Executes grunt and runs a specified command (e.g. install / update) |
|
| 73 | - */ |
|
| 72 | + * Executes grunt and runs a specified command (e.g. install / update) |
|
| 73 | + */ |
|
| 74 | 74 | public function execute() |
| 75 | 75 | { |
| 76 | 76 | // if npm does not work, we cannot use grunt, so we return false |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | // Handle options: |
| 54 | 54 | if (isset($options['directory'])) { |
| 55 | - $this->directory = $path . DIRECTORY_SEPARATOR . $options['directory']; |
|
| 55 | + $this->directory = $path.DIRECTORY_SEPARATOR.$options['directory']; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | if (isset($options['task'])) { |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // build the grunt command |
| 86 | - $cmd = 'cd %s && ' . $this->grunt; |
|
| 86 | + $cmd = 'cd %s && '.$this->grunt; |
|
| 87 | 87 | if (IS_WIN) { |
| 88 | - $cmd = 'cd /d %s && ' . $this->grunt; |
|
| 88 | + $cmd = 'cd /d %s && '.$this->grunt; |
|
| 89 | 89 | } |
| 90 | 90 | $cmd .= ' --no-color'; |
| 91 | 91 | $cmd .= ' --gruntfile %s'; |
@@ -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 | |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | - * Executes Composer and runs a specified command (e.g. install / update) |
|
| 49 | - */ |
|
| 48 | + * Executes Composer and runs a specified command (e.g. install / update) |
|
| 49 | + */ |
|
| 50 | 50 | public function execute() |
| 51 | 51 | { |
| 52 | 52 | $cmd = 'rm -Rf "%s"'; |
@@ -53,13 +53,13 @@ |
||
| 53 | 53 | if (IS_WIN) { |
| 54 | 54 | $cmd = 'rmdir /S /Q "%s"'; |
| 55 | 55 | } |
| 56 | - $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.phar'); |
|
| 57 | - $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.lock'); |
|
| 56 | + $this->phpci->executeCommand($cmd, $this->phpci->buildPath.'composer.phar'); |
|
| 57 | + $this->phpci->executeCommand($cmd, $this->phpci->buildPath.'composer.lock'); |
|
| 58 | 58 | |
| 59 | 59 | $success = true; |
| 60 | 60 | |
| 61 | 61 | foreach ($this->remove as $file) { |
| 62 | - $ok = $this->phpci->executeCommand($cmd, $this->phpci->buildPath . $file); |
|
| 62 | + $ok = $this->phpci->executeCommand($cmd, $this->phpci->buildPath.$file); |
|
| 63 | 63 | |
| 64 | 64 | if (!$ok) { |
| 65 | 65 | $success = false; |
@@ -44,22 +44,22 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | // calculate total results |
| 46 | 46 | foreach ($this->results->testsuite as $testsuite) { |
| 47 | - $this->totalTests += (int) $testsuite['tests']; |
|
| 48 | - $this->totalTimeTaken += (float) $testsuite['time']; |
|
| 49 | - $this->totalFailures += (int) $testsuite['failures']; |
|
| 47 | + $this->totalTests += (int)$testsuite['tests']; |
|
| 48 | + $this->totalTimeTaken += (float)$testsuite['time']; |
|
| 49 | + $this->totalFailures += (int)$testsuite['failures']; |
|
| 50 | 50 | |
| 51 | 51 | foreach ($testsuite->testcase as $testcase) { |
| 52 | 52 | $testresult = array( |
| 53 | - 'suite' => (string) $testsuite['name'], |
|
| 54 | - 'file' => str_replace($this->phpci->buildPath, '/', (string) $testcase['file']), |
|
| 55 | - 'name' => (string) $testcase['name'], |
|
| 56 | - 'feature' => (string) $testcase['feature'], |
|
| 57 | - 'assertions' => (int) $testcase['assertions'], |
|
| 58 | - 'time' => (float) $testcase['time'] |
|
| 53 | + 'suite' => (string)$testsuite['name'], |
|
| 54 | + 'file' => str_replace($this->phpci->buildPath, '/', (string)$testcase['file']), |
|
| 55 | + 'name' => (string)$testcase['name'], |
|
| 56 | + 'feature' => (string)$testcase['feature'], |
|
| 57 | + 'assertions' => (int)$testcase['assertions'], |
|
| 58 | + 'time' => (float)$testcase['time'] |
|
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | 61 | if (isset($testcase['class'])) { |
| 62 | - $testresult['class'] = (string) $testcase['class']; |
|
| 62 | + $testresult['class'] = (string)$testcase['class']; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // PHPUnit testcases does not have feature field. Use class::method instead |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | if (isset($testcase->failure)) { |
| 71 | 71 | $testresult['pass'] = false; |
| 72 | - $testresult['message'] = (string) $testcase->failure; |
|
| 72 | + $testresult['message'] = (string)$testcase->failure; |
|
| 73 | 73 | } else { |
| 74 | 74 | $testresult['pass'] = true; |
| 75 | 75 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $diagnostic = $this->processYamlBlock($matches[1]); |
| 157 | 157 | $test = array_pop($this->results); |
| 158 | 158 | if (isset($test['message'], $diagnostic['message'])) { |
| 159 | - $test['message'] .= PHP_EOL . $diagnostic['message']; |
|
| 159 | + $test['message'] .= PHP_EOL.$diagnostic['message']; |
|
| 160 | 160 | unset($diagnostic['message']); |
| 161 | 161 | } |
| 162 | 162 | $this->results[] = array_replace($test, $diagnostic); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | protected function processYamlBlock($indent) |
| 237 | 237 | { |
| 238 | 238 | $startLine = $this->lineNumber + 1; |
| 239 | - $endLine = $indent . '...'; |
|
| 239 | + $endLine = $indent.'...'; |
|
| 240 | 240 | $yamlLines = array(); |
| 241 | 241 | |
| 242 | 242 | do { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | public function getPluginClasses() |
| 66 | 66 | { |
| 67 | 67 | return array_map( |
| 68 | - function (Plugin $plugin) { |
|
| 68 | + function(Plugin $plugin) { |
|
| 69 | 69 | return $plugin->class; |
| 70 | 70 | }, |
| 71 | 71 | $this->getInstalledPlugins() |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | ) { |
| 141 | 141 | $newPlugin = clone $plugin; |
| 142 | 142 | |
| 143 | - $newPlugin->class = $rootNamespace . $newPlugin->class; |
|
| 143 | + $newPlugin->class = $rootNamespace.$newPlugin->class; |
|
| 144 | 144 | |
| 145 | 145 | if (!isset($newPlugin->name)) { |
| 146 | 146 | $newPlugin->name = ""; |
@@ -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\Plugin; |
| 11 | 11 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | $this->build = $build; |
| 36 | 36 | |
| 37 | 37 | if (isset($options['executable'])) { |
| 38 | - $this->executable = $this->phpci->buildPath . DIRECTORY_SEPARATOR.$options['executable']; |
|
| 38 | + $this->executable = $this->phpci->buildPath.DIRECTORY_SEPARATOR.$options['executable']; |
|
| 39 | 39 | } else { |
| 40 | 40 | $this->executable = $this->phpci->findBinary('atoum'); |
| 41 | 41 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $cmd .= " -c '{$this->config}'"; |
| 69 | 69 | } |
| 70 | 70 | if ($this->directory !== null) { |
| 71 | - $dirPath = $this->phpci->buildPath . DIRECTORY_SEPARATOR . $this->directory; |
|
| 71 | + $dirPath = $this->phpci->buildPath.DIRECTORY_SEPARATOR.$this->directory; |
|
| 72 | 72 | $cmd .= " -d '{$dirPath}'"; |
| 73 | 73 | } |
| 74 | 74 | chdir($this->phpci->buildPath); |