| 1 | <?php |
||
| 5 | trait MinMaxStep |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var null|float |
||
| 9 | */ |
||
| 10 | private $min = null; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var null|float |
||
| 14 | */ |
||
| 15 | private $max = null; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string|float |
||
| 19 | */ |
||
| 20 | private $step = 'any'; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Set value for `min` attribute. |
||
| 24 | * |
||
| 25 | * @param float $min |
||
| 26 | * @return $this |
||
| 27 | */ |
||
| 28 | public function min(float $min) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Set value for `max` attribute. |
||
| 37 | * |
||
| 38 | * @param float $max |
||
| 39 | * @return $this |
||
| 40 | */ |
||
| 41 | public function max(float $max) |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Set value for `step` attribute. Default is `any`. |
||
| 50 | * |
||
| 51 | * @param float $step |
||
| 52 | * @return $this |
||
| 53 | */ |
||
| 54 | public function step(float $step) |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Check if `min` attribute values specified. |
||
| 63 | * |
||
| 64 | * @return bool |
||
| 65 | */ |
||
| 66 | public function hasMin(): bool |
||
| 70 | |||
| 71 | /** |
||
| 72 | * Check if `max` attribute values specified. |
||
| 73 | * |
||
| 74 | * @return bool |
||
| 75 | */ |
||
| 76 | public function hasMax(): bool |
||
| 80 | |||
| 81 | /** |
||
| 82 | * Retrieve `min` attribute value. |
||
| 83 | * |
||
| 84 | * @return null|float |
||
| 85 | */ |
||
| 86 | public function getMin(): ?float |
||
| 90 | |||
| 91 | /** |
||
| 92 | * Retrieve `min` attribute value. |
||
| 93 | * |
||
| 94 | * @return null|float |
||
| 95 | */ |
||
| 96 | public function getMax(): ?float |
||
| 100 | |||
| 101 | /** |
||
| 102 | * Retrieve `step` attribute value. |
||
| 103 | * |
||
| 104 | * @return float|string |
||
| 105 | */ |
||
| 106 | public function getStep() |
||
| 110 | } |
||
| 111 |