Completed
Push — master ( 9d818b...bc28b8 )
by FX
03:09
created

ProjectDTO::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Copyright (c) 2017 Francois-Xavier Soubirou.
4
 *
5
 * This file is part of ci-report.
6
 *
7
 * ci-report is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation, either version 3 of the License, or
10
 * (at your option) any later version.
11
 *
12
 * ci-report is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with ci-report. If not, see <http://www.gnu.org/licenses/>.
19
 */
20
declare(strict_types=1);
21
22
namespace AppBundle\DTO;
23
24
use JMS\Serializer\Annotation\Type;
25
use Symfony\Component\Validator\Constraints as Assert;
26
27
/**
28
 * Project data transfert object class.
29
 *
30
 * @category  ci-report app
31
 *
32
 * @author    Francois-Xavier Soubirou <[email protected]>
33
 * @copyright 2017 Francois-Xavier Soubirou
34
 * @license   http://www.gnu.org/licenses/   GPLv3
35
 *
36
 * @see      https://ci-report.io
37
 */
38
class ProjectDTO
39
{
40
    /**
41
     * Name of the project.
42
     *
43
     * @var string
44
     *
45
     * @Type("string")
46
     *
47
     * @Assert\NotBlank
48
     */
49
    private $name;
50
51
    /**
52
     * Tests warning limit. Integer between 0 and 100 %.
53
     *
54
     * @var int
55
     *
56
     * @Type("integer")
57
     *
58
     * @Assert\NotBlank
59
     * @Assert\Range(min=0, max=100)
60
     */
61
    private $warning;
62
63
    /**
64
     * Tests success limit. Integer between 0 and 100 %.
65
     *
66
     * @var int
67
     *
68
     * @Type("integer")
69
     *
70
     * @Assert\NotBlank
71
     * @Assert\Range(min=0, max=100)
72
     */
73
    private $success;
74
75
    /**
76
     * Email.
77
     *
78
     * @var string
79
     *
80
     * @Type("string")
81
     *
82
     * @Assert\NotBlank
83
     * @Assert\Email(strict=true)
84
     */
85
    private $email;
86
87
    /**
88
     * Set name.
89
     *
90
     * @param string $name
91
     *
92
     * @return Project
93
     */
94
    public function setName(string $name): Project
95
    {
96
        $this->name = $name;
97
98
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type AppBundle\DTO\ProjectDTO which is incompatible with the type-hinted return AppBundle\DTO\Project.
Loading history...
99
    }
100
101
    /**
102
     * Get name.
103
     *
104
     * @return string
105
     */
106
    public function getName(): string
107
    {
108
        return $this->name;
109
    }
110
111
    /**
112
     * Set warning limit.
113
     *
114
     * @param int $warning
115
     *
116
     * @return Project
117
     */
118
    public function setWarning(int $warning): Project
119
    {
120
        $this->warning = $warning;
121
122
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type AppBundle\DTO\ProjectDTO which is incompatible with the type-hinted return AppBundle\DTO\Project.
Loading history...
123
    }
124
125
    /**
126
     * Get warning limit.
127
     *
128
     * @return int
129
     */
130
    public function getWarning(): int
131
    {
132
        return $this->warning;
133
    }
134
135
    /**
136
     * Set success limit.
137
     *
138
     * @param int $success
139
     *
140
     * @return Project
141
     */
142
    public function setSuccess(int $success): Project
143
    {
144
        $this->success = $success;
145
146
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type AppBundle\DTO\ProjectDTO which is incompatible with the type-hinted return AppBundle\DTO\Project.
Loading history...
147
    }
148
149
    /**
150
     * Get success limit.
151
     *
152
     * @return int
153
     */
154
    public function getSuccess(): int
155
    {
156
        return $this->success;
157
    }
158
159
    /**
160
     * Set email.
161
     *
162
     * @param string $email
163
     *
164
     * @return Project
165
     */
166
    public function setEmail(string $email): Project
167
    {
168
        $this->email = $email;
169
170
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type AppBundle\DTO\ProjectDTO which is incompatible with the type-hinted return AppBundle\DTO\Project.
Loading history...
171
    }
172
173
    /**
174
     * Get email.
175
     *
176
     * @return string
177
     */
178
    public function getEmail(): string
179
    {
180
        return $this->email;
181
    }
182
}
183