Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
50.00% covered (danger)
50.00%
1 / 2
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
NotAcceptedException
50.00% covered (danger)
50.00%
1 / 2
50.00% covered (danger)
50.00%
1 / 2
2.50
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getStatusCode
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2namespace Apie\Serializer\Exceptions;
3
4use Apie\Core\Exceptions\ApieException;
5use Apie\Core\Exceptions\HttpStatusCodeException;
6
7class NotAcceptedException extends ApieException implements HttpStatusCodeException
8{
9    public function __construct(string $acceptHeader)
10    {
11        parent::__construct(sprintf('Accept header: "%s" not accepted!', $acceptHeader));
12    }
13
14    public function getStatusCode(): int
15    {
16        return 406;
17    }
18}