Passed
Push — master ( 958054...6a5936 )
by Mihail
02:02
created

HTTPNotFound::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Koded\Framework;
4
5
use Koded\Http\Interfaces\HttpStatus;
6
use function array_map;
7
use function join;
8
9
class HTTPNotFound extends HTTPError
10
{
11 1
    public function __construct(...$args)
12
    {
13 1
        parent::__construct(HttpStatus::NOT_FOUND, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

13
        parent::__construct(HttpStatus::NOT_FOUND, /** @scrutinizer ignore-type */ ...$args);
Loading history...
14
    }
15
}
16
17
class HTTPBadRequest extends HTTPError
18
{
19
    public function __construct(...$args)
20
    {
21
        parent::__construct(HttpStatus::BAD_REQUEST, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

21
        parent::__construct(HttpStatus::BAD_REQUEST, /** @scrutinizer ignore-type */ ...$args);
Loading history...
22
    }
23
}
24
25
class HTTPMethodNotAllowed extends HTTPError
26
{
27 2
    public function __construct(array $allowed, ...$args)
28
    {
29 2
        $args['headers']['Allow'] = join(',', array_map('strtoupper', $allowed));
30 2
        parent::__construct(HttpStatus::METHOD_NOT_ALLOWED, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

30
        parent::__construct(HttpStatus::METHOD_NOT_ALLOWED, /** @scrutinizer ignore-type */ ...$args);
Loading history...
31
    }
32
}
33
34
class HTTPConflict extends HTTPError
35
{
36 7
    public function __construct(...$args)
37
    {
38 7
        parent::__construct(HttpStatus::CONFLICT, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

38
        parent::__construct(HttpStatus::CONFLICT, /** @scrutinizer ignore-type */ ...$args);
Loading history...
39
    }
40
}
41
42
class HTTPServiceNotFound extends HTTPError
43
{
44
    public function __construct(...$args)
45
    {
46
        parent::__construct(HttpStatus::SERVICE_NOT_FOUND, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

46
        parent::__construct(HttpStatus::SERVICE_NOT_FOUND, /** @scrutinizer ignore-type */ ...$args);
Loading history...
47
    }
48
}
49
50
class HTTPUnsupportedMediaType extends HTTPError
51
{
52
    public function __construct(...$args)
53
    {
54
        parent::__construct(HttpStatus::UNSUPPORTED_MEDIA_TYPE, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

54
        parent::__construct(HttpStatus::UNSUPPORTED_MEDIA_TYPE, /** @scrutinizer ignore-type */ ...$args);
Loading history...
55
    }
56
}
57
58
class HTTPUnprocessableEntity extends HTTPError
59
{
60
    public function __construct(...$args)
61
    {
62
        parent::__construct(HttpStatus::UNPROCESSABLE_ENTITY, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

62
        parent::__construct(HttpStatus::UNPROCESSABLE_ENTITY, /** @scrutinizer ignore-type */ ...$args);
Loading history...
63
    }
64
}
65
66
class HTTPFailedDependency extends HTTPError
67
{
68
    public function __construct(...$args)
69
    {
70
        parent::__construct(HttpStatus::FAILED_DEPENDENCY, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

70
        parent::__construct(HttpStatus::FAILED_DEPENDENCY, /** @scrutinizer ignore-type */ ...$args);
Loading history...
71
    }
72
}
73
74
class HTTPUnauthorized extends HTTPError
75
{
76
    public function __construct(...$args)
77
    {
78
        parent::__construct(HttpStatus::UNAUTHORIZED, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

78
        parent::__construct(HttpStatus::UNAUTHORIZED, /** @scrutinizer ignore-type */ ...$args);
Loading history...
79
    }
80
}
81
82
class HTTPForbidden extends HTTPError
83
{
84
    public function __construct(...$args)
85
    {
86
        parent::__construct(HttpStatus::FORBIDDEN, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

86
        parent::__construct(HttpStatus::FORBIDDEN, /** @scrutinizer ignore-type */ ...$args);
Loading history...
87
    }
88
}
89
90
class HTTPNotImplemented extends HTTPError
91
{
92 1
    public function __construct(...$args)
93
    {
94 1
        parent::__construct(HttpStatus::NOT_IMPLEMENTED, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

94
        parent::__construct(HttpStatus::NOT_IMPLEMENTED, /** @scrutinizer ignore-type */ ...$args);
Loading history...
95
    }
96
}
97
98
class HTTPServerError extends HTTPError
99
{
100
    public function __construct(...$args)
101
    {
102
        parent::__construct(HttpStatus::INTERNAL_SERVER_ERROR, ...$args);
0 ignored issues
show
Bug introduced by
$args is expanded, but the parameter $title of Koded\Framework\HTTPError::__construct() does not expect variable arguments. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

102
        parent::__construct(HttpStatus::INTERNAL_SERVER_ERROR, /** @scrutinizer ignore-type */ ...$args);
Loading history...
103
    }
104
}
105