Completed
Push — master ( cbfed7...c39fb6 )
by Rafael
05:06
created

ResolverContext::setDefinitionManager()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Resolver;
12
13
use GraphQL\Type\Definition\ResolveInfo;
14
use Ynlo\GraphQLBundle\Definition\ExecutableDefinitionInterface;
15
use Ynlo\GraphQLBundle\Definition\Registry\DefinitionManager;
16
17
/**
18
 * Context used for resolvers
19
 */
20
class ResolverContext
21
{
22
    protected $root;
23
24
    protected $args = [];
25
26
    /**
27
     * @var ExecutableDefinitionInterface
28
     */
29
    protected $definition;
30
31
    /**
32
     * @var DefinitionManager
33
     */
34
    protected $definitionManager;
35
36
    /**
37
     * @var ResolveInfo
38
     */
39
    protected $resolveInfo;
40
41
    /**
42
     * @return mixed
43
     */
44
    public function getRoot()
45
    {
46
        return $this->root;
47
    }
48
49
    /**
50
     * @param mixed $root
51
     */
52 14
    public function setRoot($root)
53
    {
54 14
        $this->root = $root;
55 14
    }
56
57
    /**
58
     * @return array
59
     */
60
    public function getArgs(): array
61
    {
62
        return $this->args;
63
    }
64
65
    /**
66
     * @param array $args
67
     */
68 14
    public function setArgs(array $args)
69
    {
70 14
        $this->args = $args;
71 14
    }
72
73
    /**
74
     * @return ExecutableDefinitionInterface
75
     */
76 12
    public function getDefinition()
77
    {
78 12
        return $this->definition;
79
    }
80
81
    /**
82
     * @param ExecutableDefinitionInterface $definition
83
     */
84 14
    public function setDefinition(ExecutableDefinitionInterface $definition)
85
    {
86 14
        $this->definition = $definition;
87 14
    }
88
89
    /**
90
     * @return DefinitionManager
91
     */
92 14
    public function getDefinitionManager(): DefinitionManager
93
    {
94 14
        return $this->definitionManager;
95
    }
96
97
    /**
98
     * @param DefinitionManager $manager
99
     */
100 14
    public function setDefinitionManager(DefinitionManager $manager)
101
    {
102 14
        $this->definitionManager = $manager;
103 14
    }
104
105
    /**
106
     * @return ResolveInfo
107
     */
108
    public function getResolveInfo(): ResolveInfo
109
    {
110
        return $this->resolveInfo;
111
    }
112
113
    /**
114
     * @param ResolveInfo $resolveInfo
115
     */
116 14
    public function setResolveInfo(ResolveInfo $resolveInfo)
117
    {
118 14
        $this->resolveInfo = $resolveInfo;
119 14
    }
120
}
121