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

ResolveInfo   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 1 Features 0
Metric Value
wmc 5
c 4
b 1
f 0
lcom 1
cbo 1
dl 0
loc 52
ccs 13
cts 13
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getExecutionContext() 0 4 1
A getField() 0 4 1
A getFieldASTList() 0 4 1
A getReturnType() 0 4 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