Completed
Push — master ( 20056a...86f14a )
by Johannes Skov
02:44
created
src/Console/Application/Vpu.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
      * Overridden so that the application doesn't expect the command
55 55
      * name to be the first argument.
56 56
      *
57
-     * @return InputDefinition
57
+     * @return \Symfony\Component\Console\Input\InputDefinition
58 58
      */
59 59
     public function getDefinition()
60 60
     {
Please login to merge, or discard this patch.
src/Core/Parser.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     /**
45 45
      * Require bootstrap if vpu can find it
46 46
      *
47
-     * @param array $tests
47
+     * @param string[] $tests
48 48
      *
49 49
      * @return void
50 50
      */
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
     /**
190 190
      * Convert camelCase to friendly name
191 191
      *
192
-     * @param sreing $camelCaseString
192
+     * @param string $camelCaseString
193 193
      *
194 194
      * @return string
195 195
      */
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
                 $case2 = strpos($filename, 'Tests');
57 57
                 
58 58
                 if (is_numeric($case1)) {
59
-                    $path = substr($filename, 0, $case1 + 6) . 'bootstrap.php';
59
+                    $path = substr($filename, 0, $case1 + 6).'bootstrap.php';
60 60
                     if (file_exists($path)) {
61 61
                         require_once $path;
62 62
                     }
63 63
                 }
64 64
                 if (is_numeric($case2)) {
65
-                    $path = substr($filename, 0, $case2 + 6) . 'bootstrap.php';
65
+                    $path = substr($filename, 0, $case2 + 6).'bootstrap.php';
66 66
                     if (file_exists($path)) {
67 67
                         require_once $path;
68 68
                     }
@@ -88,26 +88,26 @@  discard block
 block discarded – undo
88 88
         $tests = [];
89 89
         foreach ($result->passed() as $key => $value) {
90 90
             $tests[] = $this->parseTest('passed', $key);
91
-            $passed ++;
91
+            $passed++;
92 92
         }
93 93
         foreach ($result->failures() as $obj) {
94 94
             $tests[] = $this->parseTest('failed', $obj);
95
-            $failed ++;
95
+            $failed++;
96 96
         }
97 97
         foreach ($result->skipped() as $obj) {
98 98
             $tests[] = $this->parseTest('skipped', $obj);
99
-            $skipped ++;
99
+            $skipped++;
100 100
         }
101 101
         foreach ($result->notImplemented() as $obj) {
102 102
             $tests[] = $this->parseTest('notImplemented', $obj);
103
-            $notImplemented ++;
103
+            $notImplemented++;
104 104
         }
105 105
         foreach ($result->errors() as $obj) {
106 106
             $tests[] = $this->parseTest('error', $obj);
107
-            $error ++;
107
+            $error++;
108 108
         }
109 109
         
110
-        usort($tests, function ($a, $b) {
110
+        usort($tests, function($a, $b) {
111 111
             return strnatcmp($a['class'], $b['class']);
112 112
         });
113 113
         
@@ -132,17 +132,17 @@  discard block
 block discarded – undo
132 132
      */
133 133
     private function filterTrace($trace)
134 134
     {
135
-        $vpuPath = realpath(__DIR__ . '/../');
136
-        $vendorPath = realpath(__DIR__ . '/../../vendor');
137
-        $backendPath = realpath(__DIR__ . '/../../backend');
135
+        $vpuPath = realpath(__DIR__.'/../');
136
+        $vendorPath = realpath(__DIR__.'/../../vendor');
137
+        $backendPath = realpath(__DIR__.'/../../backend');
138 138
         
139 139
         $newTrace = [];
140
-        if (! empty($trace)) {
140
+        if (!empty($trace)) {
141 141
             foreach ($trace as $entity) {
142 142
                 if (isset($entity['file'])
143
-                    && ! strstr($entity['file'], $vendorPath)
144
-                    && ! strstr($entity['file'], $vpuPath)
145
-                    && ! strstr($entity['file'], $backendPath)) {
143
+                    && !strstr($entity['file'], $vendorPath)
144
+                    && !strstr($entity['file'], $vpuPath)
145
+                    && !strstr($entity['file'], $backendPath)) {
146 146
                     $newTrace[] = $entity;
147 147
                 }
148 148
             }
Please login to merge, or discard this patch.
src/Core/Test.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
      * @param \Doctrine\DBAL\Connection $connection
78 78
      * @param mixed[] $result
79 79
      *
80
-     * @return boolean
80
+     * @return boolean|null
81 81
      */
82 82
     public static function store(Connection $connection, $result)
83 83
     {
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -137,53 +137,53 @@
 block discarded – undo
137 137
         $sql = "
138 138
             SELECT
139 139
             strftime('%Y-%m-%d %H:%M:%S', executed) as datetime,
140
-            ltrim(strftime('" . $unit . "', executed), '0') as unit,
140
+            ltrim(strftime('" . $unit."', executed), '0') as unit,
141 141
             COUNT() as number,
142 142
             status
143 143
             FROM tests
144 144
             WHERE executed BETWEEN datetime(?) AND datetime(?)
145 145
             AND status = 'passed'
146
-            GROUP BY strftime('" . $unit . "', executed)
146
+            GROUP BY strftime('" . $unit."', executed)
147 147
             UNION
148 148
             SELECT
149 149
             strftime('%Y-%m-%d %H:%M:%S', executed) as datetime,
150
-            ltrim(strftime('" . $unit . "', executed), '0') as unit,
150
+            ltrim(strftime('" . $unit."', executed), '0') as unit,
151 151
             COUNT() as number,
152 152
             status
153 153
             FROM tests
154 154
             WHERE executed BETWEEN datetime(?) AND datetime(?)
155 155
             AND status = 'failed'
156
-            GROUP BY strftime('" . $unit . "', executed)
156
+            GROUP BY strftime('" . $unit."', executed)
157 157
             UNION
158 158
             SELECT
159 159
             strftime('%Y-%m-%d %H:%M:%S', executed) as datetime,
160
-            ltrim(strftime('" . $unit . "', executed), '0') as unit,
160
+            ltrim(strftime('" . $unit."', executed), '0') as unit,
161 161
             COUNT() as number,
162 162
             status
163 163
             FROM tests
164 164
             WHERE executed BETWEEN datetime(?) AND datetime(?)
165 165
             AND status = 'notImplemented'
166
-            GROUP BY strftime('" . $unit . "', executed)
166
+            GROUP BY strftime('" . $unit."', executed)
167 167
             UNION
168 168
             SELECT
169 169
             strftime('%Y-%m-%d %H:%M:%S', executed) as datetime,
170
-            ltrim(strftime('" . $unit . "', executed), '0') as unit,
170
+            ltrim(strftime('" . $unit."', executed), '0') as unit,
171 171
             COUNT() as number,
172 172
             status
173 173
             FROM tests
174 174
             WHERE executed BETWEEN datetime(?) AND datetime(?)
175 175
             AND status = 'skipped'
176
-            GROUP BY strftime('" . $unit . "', executed)
176
+            GROUP BY strftime('" . $unit."', executed)
177 177
             UNION
178 178
             SELECT
179 179
             strftime('%Y-%m-%d %H:%M:%S', executed) as datetime,
180
-            ltrim(strftime('" . $unit . "', executed), '0') as unit,
180
+            ltrim(strftime('" . $unit."', executed), '0') as unit,
181 181
             COUNT() as number,
182 182
             status
183 183
             FROM tests
184 184
             WHERE executed BETWEEN datetime(?) AND datetime(?)
185 185
             AND status = 'error'
186
-            GROUP BY strftime('" . $unit . "', executed)
186
+            GROUP BY strftime('" . $unit."', executed)
187 187
             ORDER BY status";
188 188
         
189 189
         $stmt = $connection->prepare($sql);
Please login to merge, or discard this patch.
tests/ExpectedFailureTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
      */
32 32
     public function skipThisTest()
33 33
     {
34
-        if (! extension_loaded('something_bogus')) {
34
+        if (!extension_loaded('something_bogus')) {
35 35
             $this->markTestSkipped('The something_bogus extension is not available.');
36 36
         }
37 37
     }
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,6 +13,6 @@
 block discarded – undo
13 13
  */
14 14
 
15 15
 //You need to update the function name if you want to run vpu's own tests via vpu.phar
16
-if (! function_exists('composerRequire6f35294d06ff43eeb876443f450df6c4')) {
17
-    require_once realpath(__DIR__ . '/../vendor/autoload.php');
16
+if (!function_exists('composerRequire6f35294d06ff43eeb876443f450df6c4')) {
17
+    require_once realpath(__DIR__.'/../vendor/autoload.php');
18 18
 }
Please login to merge, or discard this patch.
src/Api/Application/Vpu.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@
 block discarded – undo
36 36
         $app = $this;
37 37
         $app['debug'] = true;
38 38
         
39
-        $appRoot = realpath(__DIR__ . '/../../..');
39
+        $appRoot = realpath(__DIR__.'/../../..');
40 40
         $app->register(new ConfigServiceProvider("../vpu.json"));
41 41
         
42 42
         $app->register(new DoctrineServiceProvider(), array(
43 43
             'db.options' => array(
44 44
                 'driver' => $app['config']['database']['driver'],
45
-                'path' => $appRoot . '/vpu.db',
45
+                'path' => $appRoot.'/vpu.db',
46 46
             )
47 47
         ));
48 48
         
Please login to merge, or discard this patch.
src/Api/Action/Test.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     private function isPhpUnitTestCase($path)
131 131
     {
132 132
         $result1 = preg_grep('/PHPUnit_Framework_TestCase$/', file($path));
133
-        if (! empty($result1)) {
133
+        if (!empty($result1)) {
134 134
             return true;
135 135
         }
136 136
         return false;
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
             preg_match('/^class\s([A-Za-z0-9]+).+$/', array_pop($result2), $matches2);
160 160
             $class = $matches2[1];
161 161
             require_once $path;
162
-            $obj = new ReflectionClass($namespace . '\\' . $class);
162
+            $obj = new ReflectionClass($namespace.'\\'.$class);
163 163
             $methods = [];
164 164
             foreach ($obj->getMethods() as $method) {
165
-                if ($method->class == $namespace . '\\' . $class) {
165
+                if ($method->class == $namespace.'\\'.$class) {
166 166
                     if ($method->isPublic()) {
167 167
                         $methods[] = $method->name;
168 168
                     }
Please login to merge, or discard this patch.
src/Console/Command/Run.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             $this->stop($output);
102 102
             $output->writeln('<comment>VPU stopped</comment>');
103 103
         } else {
104
-            if (! empty($input->getArgument('files'))) {
104
+            if (!empty($input->getArgument('files'))) {
105 105
                 $parser = new Parser();
106 106
                 $result = $parser->run($input->getArgument('files'));
107 107
                 Test::createTable($this->getDbConnection());
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
                 'php -S %s:%d -t %s >/dev/null 2>&1 & echo $!',
132 132
                 $config['host'],
133 133
                 $config['port'],
134
-                $this->appRoot . '/'.$config['docroot']
134
+                $this->appRoot.'/'.$config['docroot']
135 135
             );
136 136
             $output = [];
137 137
             exec($cmd, $output);
138 138
             $pid = (int) $output[0];
139
-            file_put_contents($this->appRoot . '/' . $server . '.pid', $pid);
139
+            file_put_contents($this->appRoot.'/'.$server.'.pid', $pid);
140 140
         }
141 141
     }
142 142
 
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
     private function stop()
149 149
     {
150 150
         foreach ($this->serverConfig as $server => $config) {
151
-            $path = $this->appRoot . '/' . $server . '.pid';
151
+            $path = $this->appRoot.'/'.$server.'.pid';
152 152
             if (file_exists($path)) {
153
-                exec('kill ' . file_get_contents($path));
153
+                exec('kill '.file_get_contents($path));
154 154
                 unlink($path);
155 155
             }
156 156
         }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     {
168 168
         $config = $this->config;
169 169
         $connectionParams = array(
170
-            'path' => $this->appRoot . '/vpu.db',
170
+            'path' => $this->appRoot.'/vpu.db',
171 171
             'driver' => $config['config']['database']['driver']
172 172
         );
173 173
         return DriverManager::getConnection($connectionParams, new Configuration());
Please login to merge, or discard this patch.
backend/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
  * @license http://opensource.org/licenses/BSD-3-Clause The BSD License
12 12
  * @link https://github.com/VisualPHPUnit/VisualPHPUnit VisualPHPUnit
13 13
  */
14
-require __DIR__ . '/../vendor/autoload.php';
14
+require __DIR__.'/../vendor/autoload.php';
15 15
 use Visualphpunit\Api\Application\Vpu;
16 16
 
17 17
 $app = new Vpu();
Please login to merge, or discard this patch.