@@ -68,6 +68,6 @@ |
||
68 | 68 | |
69 | 69 | public function asString(): string |
70 | 70 | { |
71 | - return 'SameSite=' . $this->value; |
|
71 | + return 'SameSite='.$this->value; |
|
72 | 72 | } |
73 | 73 | } |
@@ -37,7 +37,7 @@ |
||
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 |
@@ -45,7 +45,7 @@ discard block |
||
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 |
||
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 | } |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | public function get(string $name): ?Cookie |
36 | 36 | { |
37 | - if (! $this->has($name)) { |
|
37 | + if (!$this->has($name)) { |
|
38 | 38 | return null; |
39 | 39 | } |
40 | 40 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | $clone = clone $this; |
62 | 62 | |
63 | - if (! $clone->has($name)) { |
|
63 | + if (!$clone->has($name)) { |
|
64 | 64 | return $clone; |
65 | 65 | } |
66 | 66 |
@@ -32,7 +32,7 @@ |
||
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 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | public function get(string $name): ?SetCookie |
36 | 36 | { |
37 | - if (! $this->has($name)) { |
|
37 | + if (!$this->has($name)) { |
|
38 | 38 | return null; |
39 | 39 | } |
40 | 40 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | $clone = clone $this; |
62 | 62 | |
63 | - if (! $clone->has($name)) { |
|
63 | + if (!$clone->has($name)) { |
|
64 | 64 | return $clone; |
65 | 65 | } |
66 | 66 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public static function fromSetCookieStrings(array $setCookieStrings): self |
91 | 91 | { |
92 | - return new static(array_map(static function (string $setCookieString): SetCookie { |
|
92 | + return new static(array_map(static function(string $setCookieString): SetCookie { |
|
93 | 93 | return SetCookie::fromSetCookieString($setCookieString); |
94 | 94 | }, $setCookieStrings)); |
95 | 95 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public static function fromResponse(ResponseInterface $response): SetCookies |
101 | 101 | { |
102 | - return new static(array_map(static function (string $setCookieString): SetCookie { |
|
102 | + return new static(array_map(static function(string $setCookieString): SetCookie { |
|
103 | 103 | return SetCookie::fromSetCookieString($setCookieString); |
104 | 104 | }, $response->getHeader(static::SET_COOKIE_HEADER))); |
105 | 105 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | $time = strtotime($expires); |
125 | 125 | |
126 | - if (! is_int($time)) { |
|
126 | + if (!is_int($time)) { |
|
127 | 127 | throw new InvalidArgumentException(sprintf('Invalid expires "%s" provided', $expires)); |
128 | 128 | } |
129 | 129 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | /** @param array<string> $config */ |
210 | 210 | public static function fromConfig(array $config): self |
211 | 211 | { |
212 | - if (! isset($config['name'])) { |
|
212 | + if (!isset($config['name'])) { |
|
213 | 213 | throw new InvalidArgumentException( |
214 | 214 | "A 'name' item is required in the \$config parameter to __METHOD__. None provided." |
215 | 215 | ); |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $clone = clone $this; |
242 | 242 | |
243 | 243 | foreach ($validAttributes as $attr) { |
244 | - if (! isset($params[$attr])) { |
|
244 | + if (!isset($params[$attr])) { |
|
245 | 245 | continue; |
246 | 246 | } |
247 | 247 | |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | public function __toString(): string |
276 | 276 | { |
277 | 277 | $cookieStringParts = [ |
278 | - urlencode($this->name) . '=' . urlencode((string) $this->value), |
|
278 | + urlencode($this->name).'='.urlencode((string) $this->value), |
|
279 | 279 | ]; |
280 | 280 | |
281 | 281 | $cookieStringParts = $this->appendFormattedDomainPartIfSet($cookieStringParts); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | |
317 | 317 | $rawAttribute = array_shift($rawAttributes); |
318 | 318 | |
319 | - if (! is_string($rawAttribute)) { |
|
319 | + if (!is_string($rawAttribute)) { |
|
320 | 320 | throw new InvalidArgumentException(sprintf( |
321 | 321 | 'The provided cookie string "%s" must have at least one attribute', |
322 | 322 | $string |