Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
| InvalidContentTypeException | |
50.00% |
1 / 2 |
|
50.00% |
1 / 2 |
2.50 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getStatusCode | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | namespace Apie\RestApi\Exceptions; |
| 3 | |
| 4 | use Apie\Core\Exceptions\ApieException; |
| 5 | use Apie\Core\Exceptions\HttpStatusCodeException; |
| 6 | |
| 7 | class InvalidContentTypeException extends ApieException implements HttpStatusCodeException |
| 8 | { |
| 9 | public function __construct(string $contentType) |
| 10 | { |
| 11 | parent::__construct(sprintf('Invalid content-type header: "%s"', $contentType)); |
| 12 | } |
| 13 | |
| 14 | public function getStatusCode(): int |
| 15 | { |
| 16 | return 415; |
| 17 | } |
| 18 | } |