Total Complexity | 8 |
Total Lines | 72 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class NumberSchema extends AbstractSchema |
||
13 | { |
||
14 | 27 | public function __construct() |
|
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('number') |
|
29 | ); |
||
30 | } |
||
31 | |||
32 | 1 | return $this->with( |
|
33 | 1 | new TypeKeyword(['number', 'null']) |
|
34 | ); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return static |
||
39 | */ |
||
40 | 1 | public function minimum(?float $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(?float $maximum): self |
|
51 | { |
||
52 | 1 | return $this->with( |
|
53 | 1 | new MaximumKeyword($maximum) |
|
54 | ); |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @return static |
||
59 | */ |
||
60 | 1 | public function exclusiveMinimum(?float $exclusiveMinimum): self |
|
64 | ); |
||
65 | } |
||
66 | |||
67 | /** |
||
68 | * @return static |
||
69 | */ |
||
70 | 1 | public function exclusiveMaximum(?float $exclusiveMaximum): self |
|
74 | ); |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * @return static |
||
79 | */ |
||
80 | 1 | public function multipleOf(?float $multipleOf): self |
|
87 |