This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
12
/**
13
* @var int
14
*/
15
protected $min;
16
17
/**
18
* @var int
19
*/
20
protected $max;
21
22
/**
23
* @var string
24
*/
25
protected $message;
26
27
/**
28
* ValueRangeConstraint constructor.
29
*
30
* @param int $min
31
* @param int $max
32
* @param string $message
33
*/
34
public function __construct($min, $max, $message = null) {
35
$this->min = $min;
36
$this->max = $max;
37
$this->message = $message;
38
}
39
40
/**
41
* @param $value
42
* @param IValidationData $data
43
*
44
* @return bool
45
*/
46
public function check($value, IValidationData $data = null) {
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.