| Total Complexity | 5 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 90% |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class BitValue extends AbstractIntegerCase implements ValidateRuleInterface |
||
| 13 | { |
||
| 14 | /** @var int */ |
||
| 15 | protected $size; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param int $size number of bits to allow |
||
| 19 | */ |
||
| 20 | 9 | public function __construct(int $size) |
|
| 27 | 9 | } |
|
| 28 | |||
| 29 | /** |
||
| 30 | * Validates that the given field has an integer value that can be expressed in the appropriate number of bits. |
||
| 31 | * |
||
| 32 | * @param object $subject |
||
| 33 | * @param string $field |
||
| 34 | * |
||
| 35 | * @return bool |
||
| 36 | */ |
||
| 37 | 9 | public function __invoke($subject, string $field): bool |
|
| 46 |