Passed
Pull Request — master (#9)
by Quang
04:34
created

GraphQLError   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 54
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getVariables() 0 3 1
A getExceptions() 0 3 1
A getQuery() 0 3 1
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