| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Length extends Constraint |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var int |
||
| 12 | */ |
||
| 13 | private $min; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var int |
||
| 17 | */ |
||
| 18 | private $max; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param array $options |
||
| 22 | */ |
||
| 23 | 5 | public function __construct(array $options = []) |
|
| 29 | 3 | } |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @inheritdoc |
||
| 33 | */ |
||
| 34 | 1 | protected function getAttribute(): string |
|
| 35 | { |
||
| 36 | 1 | return 'data-parsley-length'; |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @inheritdoc |
||
| 41 | */ |
||
| 42 | 1 | protected function getValue(): string |
|
| 43 | { |
||
| 44 | 1 | return sprintf('[%d, %d]', $this->min, $this->max); |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @inheritdoc |
||
| 49 | */ |
||
| 50 | 5 | protected function configureOptions(OptionsResolver $resolver): void |
|
| 56 | ; |
||
| 57 | 5 | } |
|
| 58 | } |
||
| 59 |