| 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) |
|
| 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 |
|
| 46 | } |
||
| 47 |