Completed
Push — master ( 45ed2b...c8332f )
by Alexandr
03:53
created

ResolveInfo   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 82.35%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 6
c 3
b 1
f 0
lcom 0
cbo 0
dl 0
loc 68
ccs 14
cts 17
cp 0.8235
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getExecutionContext() 0 4 1
A getField() 0 4 1
A getFieldASTList() 0 4 1
A getReturnType() 0 4 1
A setReturnType() 0 6 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  AbstractType */
25
    protected $returnType;
26
27
    /** @var ExecutionContextInterface */
28
    protected $executionContext;
29
30 22
    public function __construct(AbstractField $field, array $fieldASTList, AbstractType $returnType, ExecutionContextInterface $executionContext)
31
    {
32 22
        $this->field            = $field;
33 22
        $this->fieldASTList     = $fieldASTList;
34 22
        $this->returnType       = $returnType;
35 22
        $this->executionContext = $executionContext;
36 22
    }
37
38
    /**
39
     * @return ExecutionContextInterface
40
     */
41 1
    public function getExecutionContext()
42
    {
43 1
        return $this->executionContext;
44
    }
45
46
    /**
47
     * @return AbstractField
48
     */
49 1
    public function getField()
50
    {
51 1
        return $this->field;
52
    }
53
54
    /**
55
     * @return Field[]
56
     */
57 1
    public function getFieldASTList()
58
    {
59 1
        return $this->fieldASTList;
60
    }
61
62
    /**
63
     * @return AbstractType
64
     */
65 2
    public function getReturnType()
66
    {
67 2
        return $this->returnType;
68
    }
69
70
    /**
71
     * @param mixed $returnType
72
     *
73
     * @return ResolveInfo
74
     */
75
    public function setReturnType($returnType)
76
    {
77
        $this->returnType = $returnType;
78
79
        return $this;
80
    }
81
82
83
}
84