| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 17 | protected function validate($input): Natural |
||
| 18 | { |
||
| 19 | $settings = $this->getSettings(); |
||
| 20 | $min = $settings['min'] ?? 0; |
||
| 21 | $max = $settings['max'] ?? PHP_INT_MAX; |
||
| 22 | |||
| 23 | Assert::that($input) |
||
| 24 | ->integerish('Must be an integer.') |
||
| 25 | ->greaterOrEqualThan($min, "Must be at least $min.") |
||
| 26 | ->lessOrEqualThan($max, "Must be at most $max."); |
||
| 27 | |||
| 28 | return Natural::fromNative($input); |
||
| 29 | } |
||
| 31 |