ExecutionContext::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
ccs 8
cts 8
cp 1
rs 9.6666
cc 2
eloc 7
nc 2
nop 6
crap 2
1
<?php
2
3
namespace Fubhy\GraphQL\Executor;
4
5
use Fubhy\GraphQL\Language\Node\OperationDefinition;
6
use Fubhy\GraphQL\Schema;
7
8
/**
9
 * Data that must be available at all points during query execution.
10
 *
11
 * Namely, schema of the type system that is currently executing,
12
 * and the fragments defined in the query document
13
 */
14
class ExecutionContext
15
{
16
    /**
17
     * @var \Fubhy\GraphQL\Schema
18
     */
19
    public $schema;
20
21
    /**
22
     * @var array
23
     */
24
    public $fragments;
25
26
    /**
27
     * @var array
28
     */
29
    public $root;
30
31
    /**
32
     * @var \Fubhy\GraphQL\Language\Node\OperationDefinition
33
     */
34
    public $operation;
35
36
    /**
37
     * @var array
38
     */
39
    public $variables;
40
41
    /**
42
     * @var array
43
     */
44
    public $errors;
45
46
    /**
47
     * Constructor.
48
     *
49
     * @param $schema
50
     * @param $fragments
51
     * @param $root
52
     * @param $operation
53
     * @param $variables
54
     * @param $errors
55
     */
56 279
    public function __construct($schema, $fragments, $root, $operation, $variables, $errors)
57
    {
58 279
        $this->schema = $schema;
59 279
        $this->fragments = $fragments;
60 279
        $this->root = $root;
61 279
        $this->operation = $operation;
62 279
        $this->variables = $variables;
63 279
        $this->errors = $errors ?: [];
64 279
    }
65
}
66