Completed
Push — master ( df309f...9e12f0 )
by Rafael
08:32
created

PageInfo   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 108
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
eloc 17
dl 0
loc 108
c 0
b 0
f 0
ccs 20
cts 20
cp 1
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A isHasNextPage() 0 3 1
A getEndCursor() 0 3 1
A isHasPreviousPage() 0 3 1
A getStartCursor() 0 3 1
A setHasPreviousPage() 0 5 1
A setHasNextPage() 0 5 1
A setEndCursor() 0 5 1
A setStartCursor() 0 5 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\Model;
12
13
use Ynlo\GraphQLBundle\Annotation as GraphQL;
14
15
/**
16
 * @GraphQL\ObjectType()
17
 */
18
class PageInfo
19
{
20
    /**
21
     * @var string
22
     *
23
     * @GraphQL\Field(type="string")
24
     */
25
    protected $startCursor = null;
26
27
    /**
28
     * @var string
29
     *
30
     * @GraphQL\Field(type="string")
31
     */
32
    protected $endCursor = null;
33
34
    /**
35
     * @var bool
36
     *
37
     * @GraphQL\Field(type="bool!")
38
     */
39
    protected $hasNextPage = false;
40
41
    /**
42
     * @var bool
43
     *
44
     * @GraphQL\Field(type="bool!")
45
     */
46
    protected $hasPreviousPage = false;
47
48
    /**
49
     * @return string
50
     */
51 6
    public function getStartCursor(): ?string
52
    {
53 6
        return $this->startCursor;
54
    }
55
56
    /**
57
     * @param string $startCursor
58
     *
59
     * @return PageInfo
60
     */
61 6
    public function setStartCursor(string $startCursor): PageInfo
62
    {
63 6
        $this->startCursor = $startCursor;
64
65 6
        return $this;
66
    }
67
68
    /**
69
     * @return string
70
     */
71 6
    public function getEndCursor(): ?string
72
    {
73 6
        return $this->endCursor;
74
    }
75
76
    /**
77
     * @param string $endCursor
78
     *
79
     * @return PageInfo
80
     */
81 6
    public function setEndCursor(string $endCursor): PageInfo
82
    {
83 6
        $this->endCursor = $endCursor;
84
85 6
        return $this;
86
    }
87
88
    /**
89
     * @return bool
90
     */
91 6
    public function isHasNextPage(): bool
92
    {
93 6
        return $this->hasNextPage;
94
    }
95
96
    /**
97
     * @param bool $hasNextPage
98
     *
99
     * @return PageInfo
100
     */
101 6
    public function setHasNextPage(bool $hasNextPage): PageInfo
102
    {
103 6
        $this->hasNextPage = $hasNextPage;
104
105 6
        return $this;
106
    }
107
108
    /**
109
     * @return bool
110
     */
111 6
    public function isHasPreviousPage(): bool
112
    {
113 6
        return $this->hasPreviousPage;
114
    }
115
116
    /**
117
     * @param bool $hasPreviousPage
118
     *
119
     * @return PageInfo
120
     */
121 6
    public function setHasPreviousPage(bool $hasPreviousPage): PageInfo
122
    {
123 6
        $this->hasPreviousPage = $hasPreviousPage;
124
125 6
        return $this;
126
    }
127
}
128