Completed
Push — master ( 49bfd8...f36e2b )
by Christoffer
02:06
created

ResolveInfo::getFieldName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Digia\GraphQL\Execution\Resolver;
4
5
use Digia\GraphQL\Execution\ResponsePath;
6
use Digia\GraphQL\Language\AST\Node\FieldNode;
7
use Digia\GraphQL\Language\AST\Node\OperationDefinitionNode;
8
use Digia\GraphQL\Type\Definition\ObjectType;
9
use Digia\GraphQL\Type\Definition\OutputTypeInterface;
10
use Digia\GraphQL\Type\SchemaInterface;
11
12
class ResolveInfo
13
{
14
    /**
15
     * @var string
16
     */
17
    protected $fieldName;
18
19
    /**
20
     * @var FieldNode[]
21
     */
22
    protected $fieldNodes;
23
24
    /**
25
     * @var OutputTypeInterface
26
     */
27
    protected $returnType;
28
29
    /**
30
     * @var ObjectType
31
     */
32
    protected $parentType;
33
34
    /**
35
     * @var ResponsePath
36
     */
37
    protected $path;
38
39
    /**
40
     * @var SchemaInterface
41
     */
42
    protected $schema;
43
44
    /**
45
     * @var array
46
     */
47
    protected $fragments;
48
49
    /**
50
     * @var mixed
51
     */
52
    protected $rootValue;
53
54
    /**
55
     * @var OperationDefinitionNode
56
     */
57
    protected $operation;
58
59
    /**
60
     * @var array
61
     */
62
    protected $variableValues;
63
64
    /**
65
     * ResolveInfo constructor.
66
     *
67
     * @param string                  $fieldName
68
     * @param FieldNode[]             $fieldNodes
69
     * @param OutputTypeInterface     $returnType
70
     * @param ObjectType              $parentType
71
     * @param ResponsePath            $path
72
     * @param SchemaInterface         $schema
73
     * @param array                   $fragments
74
     * @param mixed                   $rootValue
75
     * @param OperationDefinitionNode $operation
76
     * @param array                   $variableValues
77
     */
78
    public function __construct(
79
        string $fieldName,
80
        array $fieldNodes,
81
        OutputTypeInterface $returnType,
82
        ObjectType $parentType,
83
        ResponsePath $path,
84
        SchemaInterface $schema,
85
        array $fragments,
86
        $rootValue,
87
        OperationDefinitionNode $operation,
88
        array $variableValues
89
    ) {
90
        $this->fieldName      = $fieldName;
91
        $this->fieldNodes     = $fieldNodes;
92
        $this->returnType     = $returnType;
93
        $this->parentType     = $parentType;
94
        $this->path           = $path;
95
        $this->schema         = $schema;
96
        $this->fragments      = $fragments;
97
        $this->rootValue      = $rootValue;
98
        $this->operation      = $operation;
99
        $this->variableValues = $variableValues;
100
    }
101
102
    /**
103
     * @return string
104
     */
105
    public function getFieldName(): string
106
    {
107
        return $this->fieldName;
108
    }
109
110
    /**
111
     * @return FieldNode[]
112
     */
113
    public function getFieldNodes(): array
114
    {
115
        return $this->fieldNodes;
116
    }
117
118
    /**
119
     * @return OutputTypeInterface
120
     */
121
    public function getReturnType(): OutputTypeInterface
122
    {
123
        return $this->returnType;
124
    }
125
126
    /**
127
     * @return ObjectType
128
     */
129
    public function getParentType(): ObjectType
130
    {
131
        return $this->parentType;
132
    }
133
134
    /**
135
     * @return ResponsePath
136
     */
137
    public function getPath(): ResponsePath
138
    {
139
        return $this->path;
140
    }
141
142
    /**
143
     * @return SchemaInterface
144
     */
145
    public function getSchema(): SchemaInterface
146
    {
147
        return $this->schema;
148
    }
149
150
    /**
151
     * @return array
152
     */
153
    public function getFragments(): array
154
    {
155
        return $this->fragments;
156
    }
157
158
    /**
159
     * @return mixed
160
     */
161
    public function getRootValue()
162
    {
163
        return $this->rootValue;
164
    }
165
166
    /**
167
     * @return OperationDefinitionNode
168
     */
169
    public function getOperation(): OperationDefinitionNode
170
    {
171
        return $this->operation;
172
    }
173
174
    /**
175
     * @return array
176
     */
177
    public function getVariableValues(): array
178
    {
179
        return $this->variableValues;
180
    }
181
}
182