|
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 App\DTO; |
|
23
|
|
|
|
|
24
|
|
|
use App\Entity\Project; |
|
25
|
|
|
use JMS\Serializer\Annotation\Type; |
|
26
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* Suite limits data transfert object class. |
|
30
|
|
|
* |
|
31
|
|
|
* @category ci-report app |
|
32
|
|
|
* |
|
33
|
|
|
* @author Francois-Xavier Soubirou <[email protected]> |
|
34
|
|
|
* @copyright 2017 Francois-Xavier Soubirou |
|
35
|
|
|
* @license http://www.gnu.org/licenses/ GPLv3 |
|
36
|
|
|
* |
|
37
|
|
|
* @see https://www.ci-report.io |
|
38
|
|
|
*/ |
|
39
|
|
|
class SuiteLimitsDTO |
|
40
|
|
|
{ |
|
41
|
|
|
/** |
|
42
|
|
|
* Tests warning limit. Integer between 0 and 100 %. Limit defined on project by default. |
|
43
|
|
|
* |
|
44
|
|
|
* @var int |
|
45
|
|
|
* |
|
46
|
|
|
* @Type("integer") |
|
47
|
|
|
* |
|
48
|
|
|
* @Assert\Type("integer") |
|
49
|
|
|
* @Assert\Range(min=0, max=100) |
|
50
|
|
|
*/ |
|
51
|
|
|
protected $warning; |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Tests success limit. Integer between 0 and 100 %. Limit defined on project by default. |
|
55
|
|
|
* |
|
56
|
|
|
* @var int |
|
57
|
|
|
* |
|
58
|
|
|
* @Type("integer") |
|
59
|
|
|
* |
|
60
|
|
|
* @Assert\Type("integer") |
|
61
|
|
|
* @Assert\Range(min=0, max=100) |
|
62
|
|
|
*/ |
|
63
|
|
|
protected $success; |
|
64
|
|
|
|
|
65
|
|
|
/** |
|
66
|
|
|
* Set warning limit. |
|
67
|
|
|
* |
|
68
|
|
|
* @param int $warning |
|
69
|
|
|
* |
|
70
|
|
|
* @return SuiteLimitsDTO |
|
71
|
|
|
*/ |
|
72
|
|
|
public function setWarning(int $warning): self |
|
73
|
|
|
{ |
|
74
|
|
|
$this->warning = $warning; |
|
75
|
|
|
|
|
76
|
|
|
return $this; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* Get warning limit. |
|
81
|
|
|
* |
|
82
|
|
|
* @return int |
|
83
|
|
|
*/ |
|
84
|
|
|
public function getWarning(): ?int |
|
85
|
|
|
{ |
|
86
|
|
|
return $this->warning; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* Set success limit. |
|
91
|
|
|
* |
|
92
|
|
|
* @param int $success |
|
93
|
|
|
* |
|
94
|
|
|
* @return SuiteLimitsDTO |
|
95
|
|
|
*/ |
|
96
|
|
|
public function setSuccess(int $success): self |
|
97
|
|
|
{ |
|
98
|
|
|
$this->success = $success; |
|
99
|
|
|
|
|
100
|
|
|
return $this; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* Get success limit. |
|
105
|
|
|
* |
|
106
|
|
|
* @return int |
|
107
|
|
|
*/ |
|
108
|
|
|
public function getSuccess(): ?int |
|
109
|
|
|
{ |
|
110
|
|
|
return $this->success; |
|
111
|
|
|
} |
|
112
|
|
|
} |
|
113
|
|
|
|