| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 5 | public function negotiate(ServerRequestInterface $request): bool |
|
| 28 | { |
||
| 29 | 5 | if (!$request->hasHeader(self::HEADER)) { |
|
| 30 | 1 | return false; |
|
| 31 | } |
||
| 32 | |||
| 33 | 4 | $headers = $this->getHeaders($request); |
|
| 34 | 4 | foreach ($headers as $i => $header) { |
|
| 35 | 4 | foreach ($this->allowHeaders as $allowHeader) { |
|
| 36 | 4 | if (strtolower($allowHeader) !== strtolower($header)) { |
|
| 37 | 4 | continue; |
|
| 38 | } |
||
| 39 | |||
| 40 | 4 | unset($headers[$i]); |
|
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | 4 | return [] === $headers; |
|
| 45 | } |
||
| 73 |