Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
18 | public function parse(ServerRequestInterface $request) : ServerRequestInterface |
||
19 | { |
||
20 | $headerValues = $request->getHeader('Cookie'); |
||
21 | $cookies = []; |
||
22 | |||
23 | foreach ($headerValues as $headerValue) { |
||
24 | $parts = explode(';', str_replace('; ', ';', $headerValue)); |
||
25 | |||
26 | foreach ($parts as $part) { |
||
27 | list($key, $value) = explode('=', $part); |
||
28 | |||
29 | $cookies[$key] = $value; |
||
30 | } |
||
31 | } |
||
32 | |||
33 | return $request->withCookieParams($cookies); |
||
34 | } |
||
35 | |||
37 |