Passed
Pull Request — master (#9)
by Quang
02:23
created

GraphQLError::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Digia\Lumen\GraphQL\Models;
4
5
class GraphQLError
6
{
7
8
    /**
9
     * @var string
10
     */
11
    protected $query;
12
13
    /**
14
     * @var array
15
     */
16
    protected $variables = [];
17
18
    /**
19
     * @var \Exception[]
20
     */
21
    protected $exceptions = [];
22
23
    /**
24
     * GraphQLError constructor.
25
     *
26
     * @param $query
27
     * @param $variables
28
     * @param $exceptions
29
     */
30
    public function __construct($query, $variables, $exceptions)
31
    {
32
        $this->query      = $query;
33
        $this->variables  = $variables;
34
        $this->exceptions = $exceptions;
35
    }
36
37
    /**
38
     * @return array
39
     */
40
    public function getExceptions(): array
41
    {
42
        return $this->exceptions;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getQuery(): string
49
    {
50
        return $this->query;
51
    }
52
53
    /**
54
     * @return array
55
     */
56
    public function getVariables(): array
57
    {
58
        return $this->variables;
59
    }
60
}
61