Passed
Pull Request — master (#69)
by Christoffer
02:29
created

Conflict   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 75
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getFieldsA() 0 3 1
A getResponseName() 0 3 1
A getReason() 0 3 1
A __construct() 0 6 1
A getAllFields() 0 3 1
A getFieldsB() 0 3 1
1
<?php
2
3
namespace Digia\GraphQL\Validation\Conflict;
4
5
class Conflict
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $responseName;
11
12
    /**
13
     * @var mixed
14
     */
15
    protected $reason;
16
17
    /**
18
     * @var array
19
     */
20
    protected $fieldsA;
21
22
    /**
23
     * @var array
24
     */
25
    protected $fieldsB;
26
27
    /**
28
     * Conflict constructor.
29
     * @param string     $responseName
30
     * @param mixed     $reason
31
     * @param array|null $fieldsA
32
     * @param array|null $fieldsB
33
     */
34
    public function __construct(string $responseName, $reason, array $fieldsA, array $fieldsB)
35
    {
36
        $this->responseName = $responseName;
37
        $this->reason       = $reason;
38
        $this->fieldsA      = $fieldsA;
39
        $this->fieldsB      = $fieldsB;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getResponseName(): string
46
    {
47
        return $this->responseName;
48
    }
49
50
    /**
51
     * @return mixed
52
     */
53
    public function getReason()
54
    {
55
        return $this->reason;
56
    }
57
58
    /**
59
     * @return array
60
     */
61
    public function getFieldsA(): array
62
    {
63
        return $this->fieldsA;
64
    }
65
66
    /**
67
     * @return array
68
     */
69
    public function getFieldsB(): array
70
    {
71
        return $this->fieldsB;
72
    }
73
74
    /**
75
     * @return array
76
     */
77
    public function getAllFields(): array
78
    {
79
        return array_merge($this->fieldsA, $this->fieldsB);
80
    }
81
}
82