UnprocessableEntity::getInvalidParameters()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
c 1
b 0
f 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