PostsPage   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 47
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getPosts() 0 4 1
A setPosts() 0 4 1
A getHasNext() 0 4 1
A setHasNext() 0 4 1
A isValid() 0 8 2
1
<?php
2
3
namespace Skobkin\Bundle\PointToolsBundle\DTO\Api;
4
5
class PostsPage implements ValidableInterface
6
{
7
    /**
8
     * @var MetaPost[]|null
9
     */
10
    private $posts;
11
12
    /**
13
     * @var bool|null
14
     */
15
    private $hasNext;
16
17
    /**
18
     * @return MetaPost[]|null
19
     */
20
    public function getPosts(): ?array
21
    {
22
        return $this->posts;
23
    }
24
25
    /**
26
     * @param MetaPost[]|null $posts
27
     */
28
    public function setPosts(?array $posts): void
29
    {
30
        $this->posts = $posts;
31
    }
32
33
    public function getHasNext(): ?bool
34
    {
35
        return $this->hasNext;
36
    }
37
38
    public function setHasNext(?bool $hasNext): void
39
    {
40
        $this->hasNext = $hasNext;
41
    }
42
43
    public function isValid(): bool
44
    {
45
        if (null !== $this->posts) {
46
            return true;
47
        }
48
49
        return false;
50
    }
51
}