Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function getValue(ServerRequestInterface $request, string $name, ?string $type, bool $required = false): mixed |
||
15 | { |
||
16 | $key = $this->key ?? $this->convertNameToHeader($name); |
||
17 | $value = $request->getHeaderLine($key); |
||
18 | |||
19 | if ($required && $value === '') { |
||
20 | throw new ParameterException("Missing required header '$key'"); |
||
21 | } |
||
22 | |||
23 | return $this->filter($value, $type); |
||
24 | } |
||
32 |