Completed
Push — master ( 151de8...35ad38 )
by Alexandr
03:59
created

ResolveInfo::getField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 4
rs 10
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/*
3
* This file is a part of GraphQL project.
4
*
5
* @author Alexandr Viniychuk <[email protected]>
6
* created: 5/19/16 8:58 AM
7
*/
8
9
namespace Youshido\GraphQL\Execution;
10
11
use Youshido\GraphQL\Execution\Context\ExecutionContextInterface;
12
use Youshido\GraphQL\Field\AbstractField;
13
use Youshido\GraphQL\Parser\Ast\Field;
14
use Youshido\GraphQL\Type\AbstractType;
15
16
class ResolveInfo
17
{
18
    /** @var  AbstractField */
19
    protected $field;
20
21
    /** @var Field[] */
22
    protected $fieldASTList;
23
24
    /** @var ExecutionContextInterface */
25
    protected $executionContext;
26
27 26
    public function __construct(AbstractField $field, array $fieldASTList, ExecutionContextInterface $executionContext)
28
    {
29 26
        $this->field            = $field;
30 26
        $this->fieldASTList     = $fieldASTList;
31 26
        $this->executionContext = $executionContext;
32 26
    }
33
34
    /**
35
     * @return ExecutionContextInterface
36
     */
37 9
    public function getExecutionContext()
38
    {
39 9
        return $this->executionContext;
40
    }
41
42
    /**
43
     * @return AbstractField
44
     */
45 1
    public function getField()
46
    {
47 1
        return $this->field;
48
    }
49
50
    /**
51
     * @return Field[]
52
     */
53 1
    public function getFieldASTList()
54
    {
55 1
        return $this->fieldASTList;
56
    }
57
58
    /**
59
     * @return AbstractType
60
     */
61 3
    public function getReturnType()
62
    {
63 3
        return $this->field->getType();
64
    }
65
66
67
}
68