PreconditionFailed::getFailedPreconditions()   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 0
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 0
b 0
f 0
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 PreconditionFailed extends AbstractApiProblem
10
{
11
    /**
12
     * @var string[]
13
     */
14
    private $failedPreconditions = [];
15
16
    /**
17
     * @param string[] $failedPreconditions
18
     */
19
    public function __construct(array $failedPreconditions, string $detail = null, string $instance = null)
20
    {
21 2
        parent::__construct(
22
            'https://tools.ietf.org/html/rfc2616#section-10.4.13',
23 2
            412,
24 2
            'Precondition Failed',
25 2
            $detail,
26 2
            $instance
27
        );
28
29
        $this->failedPreconditions = $failedPreconditions;
30
    }
31 2
32 2
    /**
33
     * @return string[]
34
     */
35
    public function getFailedPreconditions(): array
36
    {
37 2
        return $this->failedPreconditions;
38
    }
39
}
40