Completed
Pull Request — master (#43)
by
unknown
11:43
created
src/Dflydev/FigCookies/SetCookie.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -149,6 +149,9 @@
 block discarded – undo
149 149
         return $this->withExpires(new DateTime('-5 years'));
150 150
     }
151 151
 
152
+    /**
153
+     * @param integer $maxAge
154
+     */
152 155
     public function withMaxAge(?int $maxAge = null) : self
153 156
     {
154 157
         $clone = clone $this;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         $time = strtotime($expires);
122 122
 
123
-        if (! is_int($time)) {
123
+        if (!is_int($time)) {
124 124
             throw new InvalidArgumentException(sprintf('Invalid expires "%s" provided', $expires));
125 125
         }
126 126
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     public function __toString() : string
216 216
     {
217 217
         $cookieStringParts = [
218
-            urlencode($this->name) . '=' . urlencode((string) $this->value),
218
+            urlencode($this->name).'='.urlencode((string) $this->value),
219 219
         ];
220 220
 
221 221
         $cookieStringParts = $this->appendFormattedDomainPartIfSet($cookieStringParts);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 
251 251
         $rawAttribute = array_shift($rawAttributes);
252 252
 
253
-        if (! is_string($rawAttribute)) {
253
+        if (!is_string($rawAttribute)) {
254 254
             throw new InvalidArgumentException(sprintf(
255 255
                 'The provided cookie string "%s" must have at least one attribute',
256 256
                 $string
Please login to merge, or discard this patch.
src/Dflydev/FigCookies/SetCookies.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function get(string $name) : ?SetCookie
37 37
     {
38
-        if (! $this->has($name)) {
38
+        if (!$this->has($name)) {
39 39
             return null;
40 40
         }
41 41
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $clone = clone $this;
63 63
 
64
-        if (! $clone->has($name)) {
64
+        if (!$clone->has($name)) {
65 65
             return $clone;
66 66
         }
67 67
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public static function fromSetCookieStrings(array $setCookieStrings) : self
94 94
     {
95
-        return new static(array_map(static function (string $setCookieString) : SetCookie {
95
+        return new static(array_map(static function(string $setCookieString) : SetCookie {
96 96
             return SetCookie::fromSetCookieString($setCookieString);
97 97
         }, $setCookieStrings));
98 98
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public static function fromResponse(ResponseInterface $response) : SetCookies
104 104
     {
105
-        return new static(array_map(static function (string $setCookieString) : SetCookie {
105
+        return new static(array_map(static function(string $setCookieString) : SetCookie {
106 106
             return SetCookie::fromSetCookieString($setCookieString);
107 107
         }, $response->getHeader(static::SET_COOKIE_HEADER)));
108 108
     }
Please login to merge, or discard this patch.
src/Dflydev/FigCookies/Cookie.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function __toString() : string
47 47
     {
48
-        return urlencode($this->name) . '=' . urlencode((string) $this->value);
48
+        return urlencode($this->name).'='.urlencode((string) $this->value);
49 49
     }
50 50
 
51 51
     /**
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $cookies = StringUtil::splitOnAttributeDelimiter($string);
67 67
 
68
-        return array_map(static function ($cookiePair) {
68
+        return array_map(static function($cookiePair) {
69 69
             return static::oneFromCookiePair($cookiePair);
70 70
         }, $cookies);
71 71
     }
Please login to merge, or discard this patch.
src/Dflydev/FigCookies/Cookies.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
     public function get(string $name) : ?Cookie
37 37
     {
38
-        if (! $this->has($name)) {
38
+        if (!$this->has($name)) {
39 39
             return null;
40 40
         }
41 41
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $clone = clone $this;
63 63
 
64
-        if (! $clone->has($name)) {
64
+        if (!$clone->has($name)) {
65 65
             return $clone;
66 66
         }
67 67
 
Please login to merge, or discard this patch.