Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
9 | 20 | public function parseMetadata(ResponseInterface $response): array |
|
10 | { |
||
11 | 20 | $metadata = []; |
|
12 | |||
13 | 20 | foreach ($response->getHeaders() as $header => $value) { |
|
14 | 18 | $position = strpos($header, static::METADATA_PREFIX); |
|
15 | 18 | if ($position === 0) { |
|
16 | 11 | $metadata[ltrim($header, static::METADATA_PREFIX)] = $response->getHeader($header)[0]; |
|
17 | 11 | } |
|
18 | 20 | } |
|
19 | |||
20 | 20 | return $metadata; |
|
21 | } |
||
22 | } |
||
23 |