Test Setup Failed
Push — master ( 80a7cc...26b8e4 )
by Alexey
02:49
created

Post::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Skobkin\Bundle\PointToolsBundle\DTO\Api;
4
5
class Post implements ValidableInterface
6
{
7
    /**
8
     * @var string|null
9
     */
10
    private $id;
11
12
    /**
13
     * @var string[]|null
14
     */
15
    private $tags;
16
17
    /**
18
     * @var string[]|null
19
     */
20
    private $files;
21
22
    /**
23
     * @var User|null
24
     */
25
    private $author;
26
27
    /**
28
     * @var string|null
29
     */
30
    private $text;
31
32
    /**
33
     * @var string|null
34
     */
35
    private $created;
36
37
    /**
38
     * @var string|null
39
     */
40
    private $type;
41
42
    /**
43
     * @var bool|null
44
     */
45
    private $private;
46
47
48
    public function getId(): ?string
49
    {
50
        return $this->id;
51
    }
52
53
    public function setId(?string $id): void
54
    {
55
        $this->id = $id;
56
    }
57
58
    /**
59
     * @return string[]|null
60
     */
61
    public function getTags(): ?array
62
    {
63
        return $this->tags;
64
    }
65
66
    public function setTags(?array $tags): void
67
    {
68
        $this->tags = $tags;
69
    }
70
71
    /**
72
     * @return string[]|null
73
     */
74
    public function getFiles(): ?array
75
    {
76
        return $this->files;
77
    }
78
79
    /**
80
     * @param string[]|null $files
81
     */
82
    public function setFiles(?array $files): void
83
    {
84
        $this->files = $files;
85
    }
86
87
    public function getAuthor(): ?User
88
    {
89
        return $this->author;
90
    }
91
92
    public function setAuthor(?User $author): void
93
    {
94
        $this->author = $author;
95
    }
96
97
    public function getText(): ?string
98
    {
99
        return $this->text;
100
    }
101
102
    public function setText(?string $text): void
103
    {
104
        $this->text = $text;
105
    }
106
107
    public function getCreated(): ?string
108
    {
109
        return $this->created;
110
    }
111
112
    public function setCreated(?string $created): void
113
    {
114
        $this->created = $created;
115
    }
116
117
    public function getType(): ?string
118
    {
119
        return $this->type;
120
    }
121
122
    public function setType(?string $type): void
123
    {
124
        $this->type = $type;
125
    }
126
127
    public function getPrivate(): ?bool
128
    {
129
        return $this->private;
130
    }
131
132
    public function isPrivate(): ?bool
133
    {
134
        return $this->private;
135
    }
136
137
    public function setPrivate(?bool $private): void
138
    {
139
        $this->private = $private;
140
    }
141
142
    public function isValid(): bool
143
    {
144
        if (
145
            null !== $this->id &&
146
            null !== $this->author &&
147
            $this->author->isValid() &&
148
            null !== $this->text &&
149
            null !== $this->created &&
150
            null !== $this->type
151
        ) {
152
            return true;
153
        }
154
155
        return false;
156
    }
157
}