Completed
Push — master ( 186982...2975e7 )
by Rafael
05:12
created

FieldExecutionContext::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
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 Ynlo\GraphQLBundle\Definition\FieldsAwareDefinitionInterface;
14
15
/**
16
 * Context where a field is executed
17
 */
18
class FieldExecutionContext
19
{
20
    /**
21
     * @var QueryExecutionContext
22
     */
23
    private $queryContext;
24
25
    /**
26
     * @var FieldsAwareDefinitionInterface
27
     */
28
    private $definition;
29
30
    /**
31
     * FieldExecutionContext constructor.
32
     *
33
     * @param QueryExecutionContext          $queryContext
34
     * @param FieldsAwareDefinitionInterface $definition
35
     */
36 2
    public function __construct(QueryExecutionContext $queryContext, FieldsAwareDefinitionInterface $definition)
37
    {
38 2
        $this->queryContext = $queryContext;
39 2
        $this->definition = $definition;
40 2
    }
41
42
    /**
43
     * @return QueryExecutionContext
44
     */
45 2
    public function getQueryContext(): QueryExecutionContext
46
    {
47 2
        return $this->queryContext;
48
    }
49
50
    /**
51
     * @return FieldsAwareDefinitionInterface
52
     */
53
    public function getDefinition(): FieldsAwareDefinitionInterface
54
    {
55
        return $this->definition;
56
    }
57
}
58