UnprocessableEntity   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 10
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A getInvalidParameters() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ApiHttp\ApiProblem\ClientError;
6
7
use Chubbyphp\ApiHttp\ApiProblem\AbstractApiProblem;
8
9
final class UnprocessableEntity extends AbstractApiProblem
10
{
11
    /**
12
     * @var array[]
13
     */
14
    private $invalidParameters = [];
15
16
    public function __construct(array $invalidParameters, string $detail = null, string $instance = null)
17
    {
18
        parent::__construct(
19
            'https://tools.ietf.org/html/rfc4918#section-11.2',
20
            422,
21 2
            'Unprocessable Entity',
22
            $detail,
23 2
            $instance
24 2
        );
25 2
26 2
        $this->invalidParameters = $invalidParameters;
27
    }
28
29
    public function getInvalidParameters(): array
30
    {
31 2
        return $this->invalidParameters;
32 2
    }
33
}
34