Total Complexity | 6 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Coverage | 92.31% |
Changes | 0 |
1 | <?php |
||
5 | class Hex implements ValidateRuleInterface |
||
6 | { |
||
7 | /** @var int */ |
||
8 | protected $max; |
||
9 | |||
10 | |||
11 | /** |
||
12 | * @param int|null $max Maximum "ceiling" value for the hex |
||
13 | */ |
||
14 | 27 | public function __construct(int $max = null) |
|
15 | { |
||
16 | 27 | $this->max = $max; |
|
17 | 27 | } |
|
18 | |||
19 | /** |
||
20 | * Sanitizes a value to a hex. |
||
21 | * |
||
22 | * @param $subject |
||
23 | * @param $field |
||
24 | * |
||
25 | * @return bool |
||
26 | */ |
||
27 | 27 | public function __invoke($subject, string $field): bool |
|
45 | } |
||
46 | } |
||
47 |