x Sorry, these patches are not available anymore due to data migration. Please run a fresh inspection.
Passed
Push — master ( adee97...2b1134 )
by Gaetano
05:58
created
tests/09HTTPTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/08ServerTest.php';
3
+include_once __DIR__.'/08ServerTest.php';
4 4
 
5 5
 /**
6 6
  * Tests which stress http features of the library.
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $methods = array();
30 30
         // as long as we are descendants, get_class_methods will list private/protected methods
31
-        foreach(get_class_methods('ServerTest') as $method)
31
+        foreach (get_class_methods('ServerTest') as $method)
32 32
         {
33 33
             if (strpos($method, 'test') === 0 && !in_array($method, $this->unsafeMethods))
34 34
             {
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
         if (version_compare(PHP_VERSION, '8.0', '>=') && $this->args['SSLVERSION'] == 0)
297 297
         {
298 298
             $version = explode('.', PHP_VERSION);
299
-            $this->client->setSSLVersion(min(4 + $version[1], 7));
299
+            $this->client->setSSLVersion(min(4+$version[1], 7));
300 300
         }
301 301
 
302 302
         $this->$method();
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
                 preg_match('/ubunutu([0-9]+)/', $output[0], $matches);
327 327
                 $ubuntuVersion = @$matches[1];
328 328
             }
329
-            if ($ubuntuVersion >= 20) {
329
+            if ($ubuntuVersion>=20) {
330 330
                 $this->markTestSkipped('HTTPS via Socket known to fail on php less than 7.2 on Ubuntu 20 and higher');
331 331
                 return;
332 332
             }
@@ -347,11 +347,11 @@  discard block
 block discarded – undo
347 347
             $version = explode('.', PHP_VERSION);
348 348
             /// @see https://docs.openssl.org/1.1.1/man3/SSL_CTX_set_security_level/#default-callback-behaviour for levels
349 349
             $this->client->setOption(\PhpXmlRpc\Client::OPT_EXTRA_SOCKET_OPTS,
350
-                array('ssl' => array('security_level' => min(2 + $version[1], 5))));
350
+                array('ssl' => array('security_level' => min(2+$version[1], 5))));
351 351
             /// @todo we should probably look deeper into the Apache config / ssl version in use to find out why this
352 352
             ///       does not work well with TLS < 1.2
353 353
             if ($this->args['SSLVERSION'] == 0) {
354
-                $this->client->setSSLVersion(min(5 + $version[1], 7));
354
+                $this->client->setSSLVersion(min(5+$version[1], 7));
355 355
             }
356 356
         }
357 357
         $this->$method();
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
         if (version_compare(PHP_VERSION, '8.0', '>=') && $this->args['SSLVERSION'] == 0)
392 392
         {
393 393
             $version = explode('.', PHP_VERSION);
394
-            $this->client->setSSLVersion(min(4 + $version[1], 7));
394
+            $this->client->setSSLVersion(min(4+$version[1], 7));
395 395
         }
396 396
 
397 397
         $this->$method();
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
         // this checks for a non-failed call
552 552
         $time = microtime(true);
553 553
         $this->send($m);
554
-        $time = microtime(true) - $time;
554
+        $time = microtime(true)-$time;
555 555
         $this->assertGreaterThan(1.0, $time);
556 556
         $this->assertLessThan(2.0, $time);
557 557
 
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
         $m = new xmlrpcmsg('tests.sleep', array(new xmlrpcval(5, 'int')));
560 560
         $time = microtime(true);
561 561
         $r = $this->send($m, array(0, PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['http_error'], PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['curl_fail']));
562
-        $time = microtime(true) - $time;
562
+        $time = microtime(true)-$time;
563 563
         $this->assertGreaterThan(2.0, $time);
564 564
         $this->assertLessThan(4.0, $time);
565 565
 
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
         $this->addQueryParams(array('SLOW_LORIS' => 1));
580 580
         $time = microtime(true);
581 581
         $this->send($m, array(0, PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['http_error'], PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['curl_fail']));
582
-        $time = microtime(true) - $time;
582
+        $time = microtime(true)-$time;
583 583
         $this->assertGreaterThan(2.0, $time);
584 584
         $this->assertLessThan(4.0, $time);
585 585
     }
Please login to merge, or discard this patch.
tests/02ValueTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/LoggerAwareTestCase.php';
3
+include_once __DIR__.'/LoggerAwareTestCase.php';
4 4
 
5 5
 /**
6 6
  * Tests involving the Value class.
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             if (version_compare(PHP_VERSION, '8.0', '>=')) {
139 139
                 $str = sprintf("%f", $v->scalarval());
140 140
             } else {
141
-                $str = (string)$v->scalarval();
141
+                $str = (string) $v->scalarval();
142 142
             }
143 143
             if (strpos($str, ',') == 1) {
144 144
                 $r = $v->serialize();
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         $this->assertequals(1, count($v1));
160 160
         $out = array('me' => array(), 'mytype' => 2, '_php_class' => null);
161 161
 
162
-        foreach($v1 as $key => $val)
162
+        foreach ($v1 as $key => $val)
163 163
         {
164 164
             $this->assertArrayHasKey($key, $out);
165 165
             $expected = $out[$key];
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         $this->assertequals(2, count($v2));
175 175
         $out = array(array('key' => 0, 'value'  => 'object'), array('key' => 1, 'value'  => 'object'));
176 176
         $i = 0;
177
-        foreach($v2 as $key => $val)
177
+        foreach ($v2 as $key => $val)
178 178
         {
179 179
             $expected = $out[$i];
180 180
             $this->assertequals($expected['key'], $key);
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     {
202 202
         // nb: make sure that  the serialized xml corresponding to this is > 10MB in size
203 203
         $data = array();
204
-        for ($i = 0; $i < 500000; $i++ ) {
204
+        for ($i = 0; $i<500000; $i++) {
205 205
             $data[] = 'hello world';
206 206
         }
207 207
 
Please login to merge, or discard this patch.