Skip to content

Commit d2c074d

Browse files
committed
feat: Fixing multiple of; Removing dedicated draft-06 test case
1 parent 022342a commit d2c074d

File tree

3 files changed

+5
-151
lines changed

3 files changed

+5
-151
lines changed

src/JsonSchema/Constraints/Drafts/Draft06/MaximumConstraint.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n
2525
return;
2626
}
2727

28+
if (!is_numeric($value)) {
29+
return;
30+
}
31+
2832
if ($value <= $schema->maximum) {
2933
return;
3034
}

src/JsonSchema/Constraints/Drafts/Draft06/MultipleOfConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n
2929
return;
3030
}
3131

32-
if (fmod($value, $schema->multipleOf) === 0) {
32+
if (fmod($value, $schema->multipleOf) === 0.0) {
3333
return;
3434
}
3535

tests/Drafts/Draft6Test.php

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)