| Total Complexity | 8 |
| Total Lines | 72 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class IntegerSchema extends AbstractSchema |
||
| 13 | { |
||
| 14 | 27 | public function __construct() |
|
| 15 | { |
||
| 16 | 27 | parent::__construct( |
|
| 17 | 27 | new TypeKeyword('integer') |
|
| 18 | ); |
||
| 19 | 27 | } |
|
| 20 | |||
| 21 | /** |
||
| 22 | * @return static |
||
| 23 | */ |
||
| 24 | 1 | public function nullable(bool $nullable = true): self |
|
| 25 | { |
||
| 26 | 1 | if (!$nullable) { |
|
| 27 | 1 | return $this->with( |
|
| 28 | 1 | new TypeKeyword('integer') |
|
| 29 | ); |
||
| 30 | } |
||
| 31 | |||
| 32 | 1 | return $this->with( |
|
| 33 | 1 | new TypeKeyword(['integer', 'null']) |
|
| 34 | ); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return static |
||
| 39 | */ |
||
| 40 | 1 | public function minimum(?int $minimum): self |
|
| 41 | { |
||
| 42 | 1 | return $this->with( |
|
| 43 | 1 | new MinimumKeyword($minimum) |
|
| 44 | ); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @return static |
||
| 49 | */ |
||
| 50 | 1 | public function maximum(?int $maximum): self |
|
| 54 | ); |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return static |
||
| 59 | */ |
||
| 60 | 1 | public function exclusiveMinimum(?int $exclusiveMinimum): self |
|
| 61 | { |
||
| 62 | 1 | return $this->with( |
|
| 63 | 1 | new ExclusiveMinimumKeyword($exclusiveMinimum) |
|
| 64 | ); |
||
| 65 | } |
||
| 66 | |||
| 67 | /** |
||
| 68 | * @return static |
||
| 69 | */ |
||
| 70 | 1 | public function exclusiveMaximum(?int $exclusiveMaximum): self |
|
| 71 | { |
||
| 72 | 1 | return $this->with( |
|
| 73 | 1 | new ExclusiveMaximumKeyword($exclusiveMaximum) |
|
| 74 | ); |
||
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return static |
||
| 79 | */ |
||
| 80 | 1 | public function multipleOf(?int $multipleOf): self |
|
| 84 | ); |
||
| 85 | } |
||
| 86 | } |
||
| 87 |