@@ -126,6 +126,9 @@ discard block |
||
126 | 126 | return $clone; |
127 | 127 | } |
128 | 128 | |
129 | + /** |
|
130 | + * @param boolean $secure |
|
131 | + */ |
|
129 | 132 | public function withSecure($secure = null) |
130 | 133 | { |
131 | 134 | $clone = clone($this); |
@@ -135,6 +138,9 @@ discard block |
||
135 | 138 | return $clone; |
136 | 139 | } |
137 | 140 | |
141 | + /** |
|
142 | + * @param boolean $httpOnly |
|
143 | + */ |
|
138 | 144 | public function withHttpOnly($httpOnly = null) |
139 | 145 | { |
140 | 146 | $clone = clone($this); |
@@ -160,6 +166,10 @@ discard block |
||
160 | 166 | return implode('; ', $cookieStringParts); |
161 | 167 | } |
162 | 168 | |
169 | + /** |
|
170 | + * @param string $name |
|
171 | + * @param string $value |
|
172 | + */ |
|
163 | 173 | public static function create($name, $value = null) |
164 | 174 | { |
165 | 175 | return new static($name, $value); |
@@ -174,7 +174,7 @@ |
||
174 | 174 | /** @var SetCookie $setCookie */ |
175 | 175 | $setCookie = new static($cookieName); |
176 | 176 | |
177 | - if (! is_null($cookieValue)) { |
|
177 | + if (!is_null($cookieValue)) { |
|
178 | 178 | $setCookie = $setCookie->withValue($cookieValue); |
179 | 179 | } |
180 | 180 |
@@ -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 |