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