@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function get($name) |
43 | 43 | { |
44 | - if (! $this->has($name)) { |
|
44 | + if (!$this->has($name)) { |
|
45 | 45 | return null; |
46 | 46 | } |
47 | 47 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | $clone = clone($this); |
79 | 79 | |
80 | - if (! $clone->has($name)) { |
|
80 | + if (!$clone->has($name)) { |
|
81 | 81 | return $clone; |
82 | 82 | } |
83 | 83 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public static function fromSetCookieStrings($setCookieStrings) |
112 | 112 | { |
113 | - return new static(array_map(function ($setCookieString) { |
|
113 | + return new static(array_map(function($setCookieString) { |
|
114 | 114 | return SetCookie::fromSetCookieString($setCookieString); |
115 | 115 | }, $setCookieStrings)); |
116 | 116 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public static function fromResponse(ResponseInterface $response) |
125 | 125 | { |
126 | - return new static(array_map(function ($setCookieString) { |
|
126 | + return new static(array_map(function($setCookieString) { |
|
127 | 127 | return SetCookie::fromSetCookieString($setCookieString); |
128 | 128 | }, $response->getHeader(static::SET_COOKIE_HEADER))); |
129 | 129 | } |
@@ -47,7 +47,7 @@ |
||
47 | 47 | */ |
48 | 48 | public static function modify(ResponseInterface $response, $name, $modify) |
49 | 49 | { |
50 | - if (! is_callable($modify)) { |
|
50 | + if (!is_callable($modify)) { |
|
51 | 51 | throw new InvalidArgumentException('$modify must be callable.'); |
52 | 52 | } |
53 | 53 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | $pairParts[1] = ''; |
18 | 18 | } |
19 | 19 | |
20 | - return array_map(function ($part) { |
|
20 | + return array_map(function($part) { |
|
21 | 21 | return urldecode($part); |
22 | 22 | }, $pairParts); |
23 | 23 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | $cookies = StringUtil::splitOnAttributeDelimiter($string); |
87 | 87 | |
88 | - return array_map(function ($cookiePair) { |
|
88 | + return array_map(function($cookiePair) { |
|
89 | 89 | return static::oneFromCookiePair($cookiePair); |
90 | 90 | }, $cookies); |
91 | 91 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | /** @var Cookie $cookie */ |
104 | 104 | $cookie = new static($cookieName); |
105 | 105 | |
106 | - if (! is_null($cookieValue)) { |
|
106 | + if (!is_null($cookieValue)) { |
|
107 | 107 | $cookie = $cookie->withValue($cookieValue); |
108 | 108 | } |
109 | 109 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function get($name) |
43 | 43 | { |
44 | - if (! $this->has($name)) { |
|
44 | + if (!$this->has($name)) { |
|
45 | 45 | return null; |
46 | 46 | } |
47 | 47 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | $clone = clone($this); |
79 | 79 | |
80 | - if (! $clone->has($name)) { |
|
80 | + if (!$clone->has($name)) { |
|
81 | 81 | return $clone; |
82 | 82 | } |
83 | 83 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | */ |
48 | 48 | public static function modify(RequestInterface $request, $name, $modify) |
49 | 49 | { |
50 | - if (! is_callable($modify)) { |
|
50 | + if (!is_callable($modify)) { |
|
51 | 51 | throw new InvalidArgumentException('$modify must be callable.'); |
52 | 52 | } |
53 | 53 |
@@ -136,6 +136,9 @@ discard block |
||
136 | 136 | return $clone; |
137 | 137 | } |
138 | 138 | |
139 | + /** |
|
140 | + * @param boolean $secure |
|
141 | + */ |
|
139 | 142 | public function withSecure($secure = null) |
140 | 143 | { |
141 | 144 | $clone = clone($this); |
@@ -145,6 +148,9 @@ discard block |
||
145 | 148 | return $clone; |
146 | 149 | } |
147 | 150 | |
151 | + /** |
|
152 | + * @param boolean $httpOnly |
|
153 | + */ |
|
148 | 154 | public function withHttpOnly($httpOnly = null) |
149 | 155 | { |
150 | 156 | $clone = clone($this); |
@@ -180,6 +186,9 @@ discard block |
||
180 | 186 | return static::create($name, $value)->rememberForever(); |
181 | 187 | } |
182 | 188 | |
189 | + /** |
|
190 | + * @param string $name |
|
191 | + */ |
|
183 | 192 | public static function createExpired($name) |
184 | 193 | { |
185 | 194 | return static::create($name)->expire(); |
@@ -166,11 +166,11 @@ discard block |
||
166 | 166 | |
167 | 167 | public function __toString() |
168 | 168 | { |
169 | - if($this->urlEncode){ |
|
169 | + if ($this->urlEncode) { |
|
170 | 170 | $cookieStringParts = [ |
171 | 171 | urlencode($this->name).'='.urlencode($this->value), |
172 | 172 | ]; |
173 | - }else{ |
|
173 | + } else { |
|
174 | 174 | $cookieStringParts = [ |
175 | 175 | $this->name.'='.$this->value, |
176 | 176 | ]; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | /** @var SetCookie $setCookie */ |
211 | 211 | $setCookie = new static($cookieName); |
212 | 212 | |
213 | - if (! is_null($cookieValue)) { |
|
213 | + if (!is_null($cookieValue)) { |
|
214 | 214 | $setCookie = $setCookie->withValue($cookieValue); |
215 | 215 | } |
216 | 216 |