Passed
Push — master ( c39fb6...9e9a0d )
by Rafael
04:42
created

NodeConnectionEdge::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
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\Model;
12
13
use Ynlo\GraphQLBundle\Annotation as GraphQL;
14
15
/**
16
 * @GraphQL\ObjectType()
17
 */
18
class NodeConnectionEdge implements EdgeInterface
19
{
20
    /**
21
     * @var NodeInterface
22
     *
23
     * @GraphQL\Field(type="Ynlo\GraphQLBundle\Model\NodeInterface!")
24
     */
25
    protected $node;
26
27
    /**
28
     * @var string
29
     *
30
     * @GraphQL\Field(type="string!")
31
     */
32
    protected $cursor;
33
34
    /**
35
     * NodeConnectionEdge constructor.
36
     *
37
     * @param NodeInterface $node
38
     * @param string        $cursor
39
     */
40 8
    public function __construct(NodeInterface $node, $cursor)
41
    {
42 8
        $this->node = $node;
43 8
        $this->cursor = $cursor;
44 8
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49 8
    public function getNode(): NodeInterface
50
    {
51 8
        return $this->node;
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57
    public function setNode(NodeInterface $node)
58
    {
59
        $this->node = $node;
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function getCursor(): string
66
    {
67
        return $this->cursor;
68
    }
69
70
    /**
71
     * {@inheritdoc}
72
     */
73
    public function setCursor(string $cursor)
74
    {
75
        $this->cursor = $cursor;
76
    }
77
}
78