Completed
Push — master ( 59abc1...a59857 )
by Beau
35s
created
src/Dflydev/FigCookies/SetCookie.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -131,6 +131,9 @@
 block discarded – undo
131 131
         return $this->withExpires(new DateTime('-5 years'));
132 132
     }
133 133
 
134
+    /**
135
+     * @param integer $maxAge
136
+     */
134 137
     public function withMaxAge(?int $maxAge = null) : self
135 138
     {
136 139
         $clone = clone($this);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
         $time = strtotime($expires);
120 120
 
121
-        if (! is_int($time)) {
121
+        if (!is_int($time)) {
122 122
             throw new \InvalidArgumentException(sprintf('Invalid expires "%s" provided', $expires));
123 123
         }
124 124
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
     public function __toString() : string
214 214
     {
215 215
         $cookieStringParts = [
216
-            urlencode($this->name) . '=' . urlencode((string) $this->value),
216
+            urlencode($this->name).'='.urlencode((string) $this->value),
217 217
         ];
218 218
 
219 219
         $cookieStringParts = $this->appendFormattedDomainPartIfSet($cookieStringParts);
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 
249 249
         $rawAttribute = array_shift($rawAttributes);
250 250
 
251
-        if (! is_string($rawAttribute)) {
251
+        if (!is_string($rawAttribute)) {
252 252
             throw new \InvalidArgumentException(sprintf(
253 253
                 'The provided cookie string "%s" must have at least one attribute',
254 254
                 $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
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
     public function get(string $name) : ?SetCookie
35 35
     {
36
-        if (! $this->has($name)) {
36
+        if (!$this->has($name)) {
37 37
             return null;
38 38
         }
39 39
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $clone = clone($this);
61 61
 
62
-        if (! $clone->has($name)) {
62
+        if (!$clone->has($name)) {
63 63
             return $clone;
64 64
         }
65 65
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     public static function fromSetCookieStrings(array $setCookieStrings) : self
92 92
     {
93
-        return new static(array_map(function (string $setCookieString) : SetCookie {
93
+        return new static(array_map(function(string $setCookieString) : SetCookie {
94 94
             return SetCookie::fromSetCookieString($setCookieString);
95 95
         }, $setCookieStrings));
96 96
     }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public static function fromResponse(ResponseInterface $response) : SetCookies
103 103
     {
104
-        return new static(array_map(function (string $setCookieString) : SetCookie {
104
+        return new static(array_map(function(string $setCookieString) : SetCookie {
105 105
             return SetCookie::fromSetCookieString($setCookieString);
106 106
         }, $response->getHeader(static::SET_COOKIE_HEADER)));
107 107
     }
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
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
     public function get(string $name) : ?Cookie
35 35
     {
36
-        if (! $this->has($name)) {
36
+        if (!$this->has($name)) {
37 37
             return null;
38 38
         }
39 39
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     {
60 60
         $clone = clone($this);
61 61
 
62
-        if (! $clone->has($name)) {
62
+        if (!$clone->has($name)) {
63 63
             return $clone;
64 64
         }
65 65
 
Please login to merge, or discard this patch.
src/Dflydev/FigCookies/FigRequestCookies.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
     public static function modify(RequestInterface $request, string $name, callable $modify) : RequestInterface
34 34
     {
35
-        if (! is_callable($modify)) {
35
+        if (!is_callable($modify)) {
36 36
             throw new InvalidArgumentException('$modify must be callable.');
37 37
         }
38 38
 
Please login to merge, or discard this patch.
src/Dflydev/FigCookies/FigResponseCookies.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 
38 38
     public static function modify(ResponseInterface $response, string $name, callable $modify) : ResponseInterface
39 39
     {
40
-        if (! is_callable($modify)) {
40
+        if (!is_callable($modify)) {
41 41
             throw new InvalidArgumentException('$modify must be callable.');
42 42
         }
43 43
 
Please login to merge, or discard this patch.
src/Dflydev/FigCookies/Modifier/SameSite.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,6 +50,6 @@
 block discarded – undo
50 50
 
51 51
     public function asString() : string
52 52
     {
53
-        return 'SameSite=' . ($this->strict ? 'Strict' : 'Lax');
53
+        return 'SameSite='.($this->strict ? 'Strict' : 'Lax');
54 54
     }
55 55
 }
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
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function __toString() : string
48 48
     {
49
-        return urlencode($this->name) . '=' . urlencode((string) $this->value);
49
+        return urlencode($this->name).'='.urlencode((string) $this->value);
50 50
     }
51 51
 
52 52
     /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     {
68 68
         $cookies = StringUtil::splitOnAttributeDelimiter($string);
69 69
 
70
-        return array_map(function ($cookiePair) {
70
+        return array_map(function($cookiePair) {
71 71
             return static::oneFromCookiePair($cookiePair);
72 72
         }, $cookies);
73 73
     }
Please login to merge, or discard this patch.