Completed
Push — master ( e9481c...48ffab )
by Bohuslav
02:48
created
src/Uri.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      *
41 41
      * @var integer
42 42
      */
43
-    const HTTP_PORT  = 80;
43
+    const HTTP_PORT = 80;
44 44
 
45 45
     /**
46 46
      * Https port
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         $port     = $this->getPort();
199 199
         $userInfo = $this->getUserInfo();
200 200
 
201
-        return ($userInfo ? $userInfo. '@' : '').$this->getHost().($port ? ':' . $port : '');
201
+        return ($userInfo ? $userInfo . '@' : '') . $this->getHost() . ($port ? ':' . $port : '');
202 202
     }
203 203
 
204 204
     /**
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         if (!empty($this->user)) {
221 221
             $userInfo = $this->user;
222 222
             if (!empty($this->password)) {
223
-                $userInfo .= ':'.$this->password;
223
+                $userInfo .= ':' . $this->password;
224 224
             }
225 225
         }
226 226
 
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
         $this->validatePath($path);
471 471
 
472 472
         $clone       = clone $this;
473
-        $clone->path = $this->urlEncode((string)$path);
473
+        $clone->path = $this->urlEncode((string) $path);
474 474
 
475 475
         return $clone;
476 476
     }
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
         $this->validateQuery($query);
498 498
 
499 499
         $clone        = clone $this;
500
-        $clone->query = $this->urlEncode((string)$query);
500
+        $clone->query = $this->urlEncode((string) $query);
501 501
 
502 502
         return $clone;
503 503
     }
@@ -566,8 +566,8 @@  discard block
 block discarded – undo
566 566
 
567 567
         $path = '/' . ltrim($path, '/');
568 568
 
569
-        return ($scheme ? $scheme.':' : '').($authority ? '//'.$authority : '')
570
-            .$path.($query ? '?' . $query : '').($fragment ? '#' . $fragment : '');
569
+        return ($scheme ? $scheme . ':' : '') . ($authority ? '//' . $authority : '')
570
+            .$path . ($query ? '?' . $query : '') . ($fragment ? '#' . $fragment : '');
571 571
     }
572 572
 
573 573
     // ------------ PRIVATE METHODS
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
             throw new InvalidArgumentException('Uri scheme must be a string');
600 600
         }
601 601
 
602
-        $scheme = str_replace('://', '', strtolower((string)$scheme));
602
+        $scheme = str_replace('://', '', strtolower((string) $scheme));
603 603
         if (!isset($this->validSchema[$scheme])) {
604 604
             throw new InvalidArgumentException('Uri scheme must be one of: "", "https", "http"');
605 605
         }
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
     {
703 703
         return preg_replace_callback(
704 704
             '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/',
705
-            function ($match) {
705
+            function($match) {
706 706
                 return rawurlencode($match[0]);
707 707
             },
708 708
             $path
Please login to merge, or discard this patch.
src/Request.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use Psr\Http\Message\UriInterface;
10 10
 
11 11
 // \HttpMessage
12
-use Kambo\HttpMessage\Uri;
13 12
 use Kambo\HttpMessage\Message;
14 13
 use Kambo\HttpMessage\Headers;
15 14
 use Kambo\HttpMessage\RequestTrait;
Please login to merge, or discard this patch.
src/RequestTrait.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -5,13 +5,11 @@
 block discarded – undo
5 5
 use InvalidArgumentException;
6 6
 
7 7
 // \Psr
8
-use Psr\Http\Message\RequestInterface;
9 8
 use Psr\Http\Message\UriInterface;
10 9
 
11 10
 // \HttpMessage
12 11
 use Kambo\HttpMessage\Uri;
13 12
 use Kambo\HttpMessage\Message;
14
-use Kambo\HttpMessage\Headers;
15 13
 
16 14
 /**
17 15
  * Shared methods for outgoing, client-side request and server request.
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
             $target = '/';
66 66
             if ($this->uri->getPath() !== null) {
67 67
                 $target = $this->uri->getPath();
68
-                $target .= (!empty($this->uri->getQuery())) ? '?'.$this->uri->getQuery() : '';
68
+                $target .= (!empty($this->uri->getQuery())) ? '?' . $this->uri->getQuery() : '';
69 69
             }
70 70
 
71 71
             $this->requestTarget = $target;
Please login to merge, or discard this patch.