Skip to content

Commit 6890b03

Browse files
committed
refactor: Correct type hints in MultipleOf
1 parent 32a72c3 commit 6890b03

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

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

28-
if (!is_numeric($value)) {
28+
if (!is_int($value) && !is_float($value)) {
2929
return;
3030
}
3131

@@ -36,7 +36,11 @@ public function check(&$value, $schema = null, ?JsonPointer $path = null, $i = n
3636
$this->addError(ConstraintError::MULTIPLE_OF(), $path, ['multipleOf' => $schema->multipleOf, 'found' => $value]);
3737
}
3838

39-
private function isMultipleOf($number1, $number2)
39+
/**
40+
* @param int|float $number1
41+
* @param int|float $number2
42+
*/
43+
private function isMultipleOf($number1, $number2): bool
4044
{
4145
$modulus = ($number1 - round($number1 / $number2) * $number2);
4246
$precision = 0.0000000001;

0 commit comments

Comments
 (0)