| Total Complexity | 3 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 9 | final class NotAcceptable extends AbstractApiProblem |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | private $accept; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string[] |
||
| 18 | */ |
||
| 19 | private $acceptables = []; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param string[] $acceptables |
||
| 23 | */ |
||
| 24 | public function __construct( |
||
| 25 | string $accept, |
||
| 26 | array $acceptables, |
||
| 27 | 2 | string $detail = null, |
|
| 28 | string $instance = null |
||
| 29 | ) { |
||
| 30 | parent::__construct( |
||
| 31 | 'https://tools.ietf.org/html/rfc2616#section-10.4.7', |
||
| 32 | 406, |
||
| 33 | 2 | 'Not Acceptable', |
|
| 34 | 2 | $detail, |
|
| 35 | 2 | $instance |
|
| 36 | 2 | ); |
|
| 37 | |||
| 38 | $this->accept = $accept; |
||
| 39 | $this->acceptables = $acceptables; |
||
| 40 | } |
||
| 41 | 2 | ||
| 42 | 2 | public function getAccept(): string |
|
| 43 | 2 | { |
|
| 44 | return $this->accept; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | 2 | * @return string[] |
|
| 49 | */ |
||
| 50 | 2 | public function getAcceptables(): array |
|
| 53 | } |
||
| 54 | } |
||
| 55 |