| Total Complexity | 2 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait MinMaxLengthTrait |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Maximum length of value. |
||
| 14 | * |
||
| 15 | * @param int $value A limit on the number of characters a user can input. |
||
| 16 | * |
||
| 17 | * @link https://html.spec.whatwg.org/multipage/input.html#attr-input-maxlength |
||
| 18 | * @link https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-maxlength |
||
| 19 | */ |
||
| 20 | 2 | public function maxlength(int $value): static |
|
| 21 | { |
||
| 22 | 2 | $new = clone $this; |
|
| 23 | 2 | $new->inputTagAttributes['maxlength'] = $value; |
|
|
|
|||
| 24 | 2 | return $new; |
|
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Minimum length of value. |
||
| 29 | * |
||
| 30 | * @param int $value A lower bound on the number of characters a user can input. |
||
| 31 | * |
||
| 32 | * @link https://html.spec.whatwg.org/multipage/input.html#attr-input-minlength |
||
| 33 | * @link https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-minlength |
||
| 34 | */ |
||
| 35 | 2 | public function minlength(int $value): static |
|
| 40 | } |
||
| 41 | } |
||
| 42 |