Error   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 33
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 21 4
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Faecie\Bundle\JsonApiErrorResponseBundle\JsonApi;
6
7
class Error
8
{
9
    private $id;
10
    private $status;
11
    private $code;
12
    private $title;
13
    private $detail;
14
    private $meta;
15
    private $links;
16
    private $source;
17
18 5
    public function __construct(
19
        string $code,
20
        ?string $id = null,
21
        ?string $aboutLink = null,
22
        ?int $status = null,
23
        ?string $title = null,
24
        ?string $detail = null,
25
        ?string $sourcePointer = null,
26
        ?string $sourceParameter = null,
27
        $meta = null
28
    ) {
29 5
        $this->id = $id;
30 5
        $this->status = $status;
31 5
        $this->code = $code;
32 5
        $this->title = $title;
33 5
        $this->detail = $detail;
34 5
        $this->meta = $meta;
35 5
        $this->links = $aboutLink !== null ? new ErrorLinks($aboutLink) : null;
36 5
        $isThereAnySource = $sourcePointer !== null || $sourceParameter !== null;
37 5
        $this->source = $isThereAnySource ? new ErrorSource($sourcePointer, $sourceParameter) : null;
38 5
    }
39
}
40