Test Setup Failed
Branch master (d474d9)
by Àlex
09:29
created
PHPCI/Plugin/Irc.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 
95 95
     /**
96 96
      * @param resource $socket
97
-     * @param array $commands
98
-     * @return bool
97
+     * @param string[] $commands
98
+     * @return boolean|null
99 99
      */
100 100
     private function executeIrcCommands($socket, array $commands)
101 101
     {
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      *
124 124
      * @param resource $socket
125 125
      * @param string $command
126
-     * @return bool
126
+     * @return boolean|null
127 127
      */
128 128
     private function executeIrcCommand($socket, $command)
129 129
     {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
         stream_set_timeout($sock, 1);
81 81
 
82 82
         $connectCommands = array(
83
-            'USER ' . $this->nick . ' 0 * :' . $this->nick,
84
-            'NICK ' . $this->nick,
83
+            'USER '.$this->nick.' 0 * :'.$this->nick,
84
+            'NICK '.$this->nick,
85 85
         );
86 86
         $this->executeIrcCommands($sock, $connectCommands);
87
-        $this->executeIrcCommand($sock, 'JOIN ' . $this->room);
88
-        $this->executeIrcCommand($sock, 'PRIVMSG ' . $this->room . ' :' . $msg);
87
+        $this->executeIrcCommand($sock, 'JOIN '.$this->room);
88
+        $this->executeIrcCommand($sock, 'PRIVMSG '.$this->room.' :'.$msg);
89 89
 
90 90
         fclose($sock);
91 91
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     private function executeIrcCommands($socket, array $commands)
101 101
     {
102 102
         foreach ($commands as $command) {
103
-            fputs($socket, $command . "\n");
103
+            fputs($socket, $command."\n");
104 104
         }
105 105
 
106 106
         $pingBack = false;
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         }
115 115
 
116 116
         if ($pingBack) {
117
-            $command = 'PONG :' . $pingBack . "\n";
117
+            $command = 'PONG :'.$pingBack."\n";
118 118
             fputs($socket, $command);
119 119
         }
120 120
     }
Please login to merge, or discard this patch.
PHPCI/Plugin/Pdepend.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 namespace PHPCI\Plugin;
11 11
 
12 12
 use PHPCI\Builder;
13
-use PHPCI\Helper\Lang;
14 13
 use PHPCI\Model\Build;
15 14
 
16 15
 /**
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
         $this->directory = isset($options['directory']) ? $options['directory'] : $phpci->buildPath;
63 63
 
64 64
         $title = $phpci->getBuildProjectTitle();
65
-        $this->summary  = $title . '-summary.xml';
66
-        $this->pyramid  = $title . '-pyramid.svg';
67
-        $this->chart    = $title . '-chart.svg';
68
-        $this->location = $this->phpci->buildPath . '..' . DIRECTORY_SEPARATOR . 'pdepend';
65
+        $this->summary  = $title.'-summary.xml';
66
+        $this->pyramid  = $title.'-pyramid.svg';
67
+        $this->chart    = $title.'-chart.svg';
68
+        $this->location = $this->phpci->buildPath.'..'.DIRECTORY_SEPARATOR.'pdepend';
69 69
     }
70 70
 
71 71
     /**
@@ -82,22 +82,22 @@  discard block
 block discarded – undo
82 82
 
83 83
         $pdepend = $this->phpci->findBinary('pdepend');
84 84
 
85
-        $cmd = $pdepend . ' --summary-xml="%s" --jdepend-chart="%s" --overview-pyramid="%s" %s "%s"';
85
+        $cmd = $pdepend.' --summary-xml="%s" --jdepend-chart="%s" --overview-pyramid="%s" %s "%s"';
86 86
 
87 87
         $this->removeBuildArtifacts();
88 88
 
89 89
         // If we need to ignore directories
90 90
         if (count($this->phpci->ignore)) {
91
-            $ignore = ' --ignore=' . implode(',', $this->phpci->ignore);
91
+            $ignore = ' --ignore='.implode(',', $this->phpci->ignore);
92 92
         } else {
93 93
             $ignore = '';
94 94
         }
95 95
 
96 96
         $success = $this->phpci->executeCommand(
97 97
             $cmd,
98
-            $this->location . DIRECTORY_SEPARATOR . $this->summary,
99
-            $this->location . DIRECTORY_SEPARATOR . $this->chart,
100
-            $this->location . DIRECTORY_SEPARATOR . $this->pyramid,
98
+            $this->location.DIRECTORY_SEPARATOR.$this->summary,
99
+            $this->location.DIRECTORY_SEPARATOR.$this->chart,
100
+            $this->location.DIRECTORY_SEPARATOR.$this->pyramid,
101 101
             $ignore,
102 102
             $this->directory
103 103
         );
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
                     "Pdepend successful. You can use %s\n, ![Chart](%s \"Pdepend Chart\")\n
111 111
                     and ![Pyramid](%s \"Pdepend Pyramid\")\n
112 112
                     for inclusion in the readme.md file",
113
-                    $config['url'] . '/build/pdepend/' . $this->summary,
114
-                    $config['url'] . '/build/pdepend/' . $this->chart,
115
-                    $config['url'] . '/build/pdepend/' . $this->pyramid
113
+                    $config['url'].'/build/pdepend/'.$this->summary,
114
+                    $config['url'].'/build/pdepend/'.$this->chart,
115
+                    $config['url'].'/build/pdepend/'.$this->pyramid
116 116
                 )
117 117
             );
118 118
         }
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
     {
128 128
         //Remove the created files first
129 129
         foreach (array($this->summary, $this->chart, $this->pyramid) as $file) {
130
-            if (file_exists($this->location . DIRECTORY_SEPARATOR . $file)) {
131
-                unlink($this->location . DIRECTORY_SEPARATOR . $file);
130
+            if (file_exists($this->location.DIRECTORY_SEPARATOR.$file)) {
131
+                unlink($this->location.DIRECTORY_SEPARATOR.$file);
132 132
             }
133 133
         }
134 134
     }
Please login to merge, or discard this patch.
PHPCI/Plugin/PhpCodeSniffer.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -185,7 +185,7 @@
 block discarded – undo
185 185
 
186 186
     /**
187 187
      * Process options and produce an arguments string for PHPCS.
188
-     * @return array
188
+     * @return string[]
189 189
      */
190 190
     protected function getFlags()
191 191
     {
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
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
 
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
     }
143 143
 
144 144
     /**
145
-    * Runs PHP Code Sniffer in a specified directory, to a specified standard.
146
-    */
145
+     * Runs PHP Code Sniffer in a specified directory, to a specified standard.
146
+     */
147 147
     public function execute()
148 148
     {
149 149
         list($ignore, $standard, $suffixes) = $this->getFlags();
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         }
123 123
 
124 124
         if (!empty($options['encoding'])) {
125
-            $this->encoding = ' --encoding=' . $options['encoding'];
125
+            $this->encoding = ' --encoding='.$options['encoding'];
126 126
         }
127 127
 
128 128
         $this->setOptions($options);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
         $this->phpci->logExecOutput(false);
154 154
 
155
-        $cmd = $phpcs . ' --report=json %s %s %s %s %s "%s"';
155
+        $cmd = $phpcs.' --report=json %s %s %s %s %s "%s"';
156 156
         $this->phpci->executeCommand(
157 157
             $cmd,
158 158
             $standard,
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             $ignore,
161 161
             $this->tab_width,
162 162
             $this->encoding,
163
-            $this->phpci->buildPath . $this->path
163
+            $this->phpci->buildPath.$this->path
164 164
         );
165 165
 
166 166
         $output = $this->phpci->getLastOutput();
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     {
192 192
         $ignore = '';
193 193
         if (count($this->ignore)) {
194
-            $ignore = ' --ignore=' . implode(',', $this->ignore);
194
+            $ignore = ' --ignore='.implode(',', $this->ignore);
195 195
         }
196 196
 
197 197
         if (strpos($this->standard, '/') !== false) {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
         $suffixes = '';
204 204
         if (count($this->suffixes)) {
205
-            $suffixes = ' --extensions=' . implode(',', $this->suffixes);
205
+            $suffixes = ' --extensions='.implode(',', $this->suffixes);
206 206
         }
207 207
 
208 208
         return array($ignore, $standard, $suffixes);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
                 $this->build->reportError(
234 234
                     $this->phpci,
235 235
                     'php_code_sniffer',
236
-                    'PHPCS: ' . $message['message'],
236
+                    'PHPCS: '.$message['message'],
237 237
                     $message['type'] == 'ERROR' ? BuildError::SEVERITY_HIGH : BuildError::SEVERITY_LOW,
238 238
                     $fileName,
239 239
                     $message['line']
Please login to merge, or discard this patch.
PHPCI/Plugin/PhpCpd.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,8 +108,8 @@
 block discarded – undo
108 108
 
109 109
     /**
110 110
      * Process the PHPCPD XML report.
111
-     * @param $xmlString
112
-     * @return array
111
+     * @param string $xmlString
112
+     * @return integer
113 113
      * @throws \Exception
114 114
      */
115 115
     protected function processReport($xmlString)
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
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
 
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
     }
68 68
 
69 69
     /**
70
-    * Runs PHP Copy/Paste Detector in a specified directory.
71
-    */
70
+     * Runs PHP Copy/Paste Detector in a specified directory.
71
+     */
72 72
     public function execute()
73 73
     {
74 74
         $ignore = '';
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         $this->ignore = $phpci->ignore;
55 55
 
56 56
         if (!empty($options['path'])) {
57
-            $this->path = $phpci->buildPath . $options['path'];
57
+            $this->path = $phpci->buildPath.$options['path'];
58 58
         }
59 59
 
60 60
         if (!empty($options['standard'])) {
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
     {
74 74
         $ignore = '';
75 75
         if (count($this->ignore)) {
76
-            $map = function ($item) {
76
+            $map = function($item) {
77 77
                 // remove the trailing slash
78 78
                 $item = rtrim($item, DIRECTORY_SEPARATOR);
79 79
 
80
-                if (is_file(rtrim($this->path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $item)) {
81
-                    return ' --names-exclude ' . $item;
80
+                if (is_file(rtrim($this->path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$item)) {
81
+                    return ' --names-exclude '.$item;
82 82
                 } else {
83
-                    return ' --exclude ' . $item;
83
+                    return ' --exclude '.$item;
84 84
                 }
85 85
 
86 86
             };
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         $tmpfilename = tempnam('/tmp', 'phpcpd');
95 95
 
96
-        $cmd = $phpcpd . ' --log-pmd "%s" %s "%s"';
96
+        $cmd = $phpcpd.' --log-pmd "%s" %s "%s"';
97 97
         $success = $this->phpci->executeCommand($cmd, $tmpfilename, $ignore, $this->path);
98 98
 
99 99
         print $this->phpci->getLastOutput();
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                     BuildError::SEVERITY_NORMAL,
143 143
                     $fileName,
144 144
                     $file['line'],
145
-                    (int) $file['line'] + (int) $duplication['lines']
145
+                    (int)$file['line'] + (int)$duplication['lines']
146 146
                 );
147 147
             }
148 148
 
Please login to merge, or discard this patch.
PHPCI/Plugin/PhpCsFixer.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 namespace PHPCI\Plugin;
11 11
 
12 12
 use PHPCI\Builder;
13
-use PHPCI\Helper\Lang;
14 13
 use PHPCI\Model\Build;
15 14
 
16 15
 /**
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
         $phpcsfixer = $this->phpci->findBinary('php-cs-fixer');
71 71
 
72
-        $cmd = $phpcsfixer . ' fix . %s %s %s';
72
+        $cmd = $phpcsfixer.' fix . %s %s %s';
73 73
         $success = $this->phpci->executeCommand($cmd, $this->verbose, $this->diff, $this->level);
74 74
 
75 75
         chdir($curdir);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         }
97 97
 
98 98
         if (isset($options['workingdir']) && $options['workingdir']) {
99
-            $this->workingdir = $this->phpci->buildPath . $options['workingdir'];
99
+            $this->workingdir = $this->phpci->buildPath.$options['workingdir'];
100 100
         }
101 101
 
102 102
     }
Please login to merge, or discard this patch.
PHPCI/Plugin/PhpMessDetector.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     /**
133 133
      * Override a default setting.
134 134
      * @param $options
135
-     * @param $key
135
+     * @param string $key
136 136
      */
137 137
     protected function overrideSetting($options, $key)
138 138
     {
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
 
144 144
     /**
145 145
      * Process PHPMD's XML output report.
146
-     * @param $xmlString
147
-     * @return array
146
+     * @param string $xmlString
147
+     * @return integer
148 148
      * @throws \Exception
149 149
      */
150 150
     protected function processReport($xmlString)
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
     /**
204 204
      * Execute PHP Mess Detector.
205
-     * @param $binaryPath
205
+     * @param null|string $binaryPath
206 206
      */
207 207
     protected function executePhpMd($binaryPath)
208 208
     {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
         foreach ($this->rules as &$rule) {
195 195
             if (strpos($rule, '/') !== false) {
196
-                $rule = $this->phpci->buildPath . $rule;
196
+                $rule = $this->phpci->buildPath.$rule;
197 197
             }
198 198
         }
199 199
 
@@ -206,18 +206,18 @@  discard block
 block discarded – undo
206 206
      */
207 207
     protected function executePhpMd($binaryPath)
208 208
     {
209
-        $cmd = $binaryPath . ' "%s" xml %s %s %s';
209
+        $cmd = $binaryPath.' "%s" xml %s %s %s';
210 210
 
211 211
         $path = $this->getTargetPath();
212 212
 
213 213
         $ignore = '';
214 214
         if (count($this->ignore)) {
215
-            $ignore = ' --exclude ' . implode(',', $this->ignore);
215
+            $ignore = ' --exclude '.implode(',', $this->ignore);
216 216
         }
217 217
 
218 218
         $suffixes = '';
219 219
         if (count($this->suffixes)) {
220
-            $suffixes = ' --suffixes ' . implode(',', $this->suffixes);
220
+            $suffixes = ' --suffixes '.implode(',', $this->suffixes);
221 221
         }
222 222
 
223 223
         // Disable exec output logging, as we don't want the XML report in the log:
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
      */
243 243
     protected function getTargetPath()
244 244
     {
245
-        $path = $this->phpci->buildPath . $this->path;
245
+        $path = $this->phpci->buildPath.$this->path;
246 246
         if (!empty($this->path) && $this->path{0} == '/') {
247 247
             $path = $this->path;
248 248
             return $path;
Please login to merge, or discard this patch.
PHPCI/Plugin/PhpUnit.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
     /**
69 69
      * Try and find the phpunit XML config file.
70
-     * @param $buildPath
70
+     * @param string $buildPath
71 71
      * @return null|string
72 72
      */
73 73
     public static function findConfigFile($buildPath)
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     /**
186 186
      * Run the tests defined in a PHPUnit config file.
187 187
      * @param $configPath
188
-     * @return bool|mixed
188
+     * @return boolean
189 189
      */
190 190
     protected function runConfigFile($configPath)
191 191
     {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     /**
214 214
      * Run the PHPUnit tests in a specific directory or array of directories.
215 215
      * @param $directory
216
-     * @return bool|mixed
216
+     * @return boolean
217 217
      */
218 218
     protected function runDir($directory)
219 219
     {
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
     /**
236 236
      * @param $array
237 237
      * @param $callable
238
-     * @return bool|mixed
238
+     * @return boolean
239 239
      */
240 240
     protected function recurseArg($array, $callable)
241 241
     {
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
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
 
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
     }
139 139
 
140 140
     /**
141
-    * Runs PHP Unit tests in a specified directory, optionally using specified config file(s).
142
-    */
141
+     * Runs PHP Unit tests in a specified directory, optionally using specified config file(s).
142
+     */
143 143
     public function execute()
144 144
     {
145 145
         if (empty($this->xmlConfigFile) && empty($this->directory)) {
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -72,20 +72,20 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public static function findConfigFile($buildPath)
74 74
     {
75
-        if (file_exists($buildPath . 'phpunit.xml')) {
75
+        if (file_exists($buildPath.'phpunit.xml')) {
76 76
             return 'phpunit.xml';
77 77
         }
78 78
 
79
-        if (file_exists($buildPath . 'tests' . DIRECTORY_SEPARATOR . 'phpunit.xml')) {
80
-            return 'tests' . DIRECTORY_SEPARATOR . 'phpunit.xml';
79
+        if (file_exists($buildPath.'tests'.DIRECTORY_SEPARATOR.'phpunit.xml')) {
80
+            return 'tests'.DIRECTORY_SEPARATOR.'phpunit.xml';
81 81
         }
82 82
 
83
-        if (file_exists($buildPath . 'phpunit.xml.dist')) {
83
+        if (file_exists($buildPath.'phpunit.xml.dist')) {
84 84
             return 'phpunit.xml.dist';
85 85
         }
86 86
 
87
-        if (file_exists($buildPath . 'tests/phpunit.xml.dist')) {
88
-            return 'tests' . DIRECTORY_SEPARATOR . 'phpunit.xml.dist';
87
+        if (file_exists($buildPath.'tests/phpunit.xml.dist')) {
88
+            return 'tests'.DIRECTORY_SEPARATOR.'phpunit.xml.dist';
89 89
         }
90 90
 
91 91
         return null;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         }
134 134
 
135 135
         if (isset($options['coverage'])) {
136
-            $this->coverage = ' --coverage-html ' . $this->phpci->interpolate($options['coverage']) . ' ';
136
+            $this->coverage = ' --coverage-html '.$this->phpci->interpolate($options['coverage']).' ';
137 137
         }
138 138
     }
139 139
 
@@ -194,13 +194,13 @@  discard block
 block discarded – undo
194 194
         } else {
195 195
             if ($this->runFrom) {
196 196
                 $curdir = getcwd();
197
-                chdir($this->phpci->buildPath . DIRECTORY_SEPARATOR . $this->runFrom);
197
+                chdir($this->phpci->buildPath.DIRECTORY_SEPARATOR.$this->runFrom);
198 198
             }
199 199
 
200 200
             $phpunit = $this->phpci->findBinary('phpunit');
201 201
 
202
-            $cmd = $phpunit . ' --tap %s -c "%s" ' . $this->coverage . $this->path;
203
-            $success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $configPath);
202
+            $cmd = $phpunit.' --tap %s -c "%s" '.$this->coverage.$this->path;
203
+            $success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath.$configPath);
204 204
 
205 205
             if ($this->runFrom) {
206 206
                 chdir($curdir);
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
 
226 226
             $phpunit = $this->phpci->findBinary('phpunit');
227 227
 
228
-            $cmd = $phpunit . ' --tap %s "%s"';
229
-            $success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath . $directory);
228
+            $cmd = $phpunit.' --tap %s "%s"';
229
+            $success = $this->phpci->executeCommand($cmd, $this->args, $this->phpci->buildPath.$directory);
230 230
             chdir($curdir);
231 231
             return $success;
232 232
         }
Please login to merge, or discard this patch.
PHPCI/Plugin/TechnicalDebt.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
     /**
141 141
      * Gets the number and list of errors returned from the search
142 142
      *
143
-     * @return array
143
+     * @return integer
144 144
      */
145 145
     public function getErrorList()
146 146
     {
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,8 +117,8 @@
 block discarded – undo
117 117
     }
118 118
 
119 119
     /**
120
-    * Runs the plugin
121
-    */
120
+     * Runs the plugin
121
+     */
122 122
     public function execute()
123 123
     {
124 124
         $success = true;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
         $errorCount = $this->getErrorList();
128 128
 
129
-        $this->phpci->log("Found $errorCount instances of " . implode(', ', $this->searches));
129
+        $this->phpci->log("Found $errorCount instances of ".implode(', ', $this->searches));
130 130
 
131 131
         $this->build->storeMeta('technical_debt-warnings', $errorCount);
132 132
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             }
164 164
 
165 165
             // Ignore hidden files, else .git, .sass_cache, etc. all get looped over
166
-            if (stripos($filePath, DIRECTORY_SEPARATOR . '.') !== false) {
166
+            if (stripos($filePath, DIRECTORY_SEPARATOR.'.') !== false) {
167 167
                 $skipFile = true;
168 168
             }
169 169
 
Please login to merge, or discard this patch.
PHPCI/Plugin/Util/Executor.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     /**
72 72
      * Check the config for any plugins specific to the branch we're currently building.
73 73
      * @param $config
74
-     * @param $stage
74
+     * @param string $stage
75 75
      * @param $pluginsToExecute
76 76
      * @return array
77 77
      */
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     /**
125 125
      * Execute the list of plugins found for a given testing stage.
126 126
      * @param $plugins
127
-     * @param $stage
127
+     * @param string $stage
128 128
      * @return bool
129 129
      * @throws \Exception
130 130
      */
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -82,12 +82,12 @@  discard block
 block discarded – undo
82 82
         $branch = $build->getBranch();
83 83
 
84 84
         // If we don't have any branch-specific plugins:
85
-        if (!isset($config['branch-' . $branch][$stage]) || !is_array($config['branch-' . $branch][$stage])) {
85
+        if (!isset($config['branch-'.$branch][$stage]) || !is_array($config['branch-'.$branch][$stage])) {
86 86
             return $pluginsToExecute;
87 87
         }
88 88
 
89 89
         // If we have branch-specific plugins to execute, add them to the list to be executed:
90
-        $branchConfig = $config['branch-' . $branch];
90
+        $branchConfig = $config['branch-'.$branch];
91 91
         $plugins = $branchConfig[$stage];
92 92
 
93 93
         $runOption = 'after';
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 if ($stage === 'setup') {
151 151
                     // If we're in the "setup" stage, execution should not continue after
152 152
                     // a plugin has failed:
153
-                    throw new Exception('Plugin failed: ' . $plugin);
153
+                    throw new Exception('Plugin failed: '.$plugin);
154 154
                 } elseif ($stage === 'test') {
155 155
                     // If we're in the "test" stage and the plugin is not allowed to fail,
156 156
                     // then mark the build as failed:
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         if (strpos($plugin, '\\') === false) {
176 176
             $class = str_replace('_', ' ', $plugin);
177 177
             $class = ucwords($class);
178
-            $class = 'PHPCI\\Plugin\\' . str_replace(' ', '', $class);
178
+            $class = 'PHPCI\\Plugin\\'.str_replace(' ', '', $class);
179 179
         } else {
180 180
             $class = $plugin;
181 181
         }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
             $obj = $this->pluginFactory->buildPlugin($class, $options);
191 191
             return $obj->execute();
192 192
         } catch (\Exception $ex) {
193
-            $this->logger->logFailure(Lang::get('exception') . $ex->getMessage(), $ex);
193
+            $this->logger->logFailure(Lang::get('exception').$ex->getMessage(), $ex);
194 194
             return false;
195 195
         }
196 196
     }
Please login to merge, or discard this patch.