| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 1 | public static function fromExpectedTypes(array $expectedTypes): self |
|
| 22 | { |
||
| 23 | 1 | $e = new self(sprintf( |
|
| 24 | 1 | 'Expected one of the following authentication headers, but none were provided, ["%s"]', |
|
| 25 | 1 | implode('", "', $expectedTypes) |
|
| 26 | )); |
||
| 27 | |||
| 28 | 1 | $e->detail = $e->getMessage(); |
|
| 29 | 1 | $e->title = self::TITLE; |
|
| 30 | 1 | $e->type = self::TYPE; |
|
| 31 | 1 | $e->status = StatusCodeInterface::STATUS_UNAUTHORIZED; |
|
| 32 | 1 | $e->additional = ['expectedTypes' => $expectedTypes]; |
|
| 33 | |||
| 34 | 1 | return $e; |
|
| 35 | } |
||
| 37 |