diff --git a/src/JsonSchema/Constraints/BaseConstraint.php b/src/JsonSchema/Constraints/BaseConstraint.php index 336f9fc9..9a4ea1e5 100644 --- a/src/JsonSchema/Constraints/BaseConstraint.php +++ b/src/JsonSchema/Constraints/BaseConstraint.php @@ -43,7 +43,7 @@ public function __construct(?Factory $factory = null) $this->factory = $factory ?: new Factory(); } - public function addError(?JsonPointer $path = null, $message, $constraint = '', array $more = null) + public function addError(?JsonPointer $path, $message, $constraint = '', ?array $more = null) { $error = array( 'property' => $this->convertJsonPointerIntoPropertyPath($path ?: new JsonPointer('')), diff --git a/src/JsonSchema/Constraints/Constraint.php b/src/JsonSchema/Constraints/Constraint.php index 6123dc28..5aaa718c 100644 --- a/src/JsonSchema/Constraints/Constraint.php +++ b/src/JsonSchema/Constraints/Constraint.php @@ -39,7 +39,7 @@ abstract class Constraint extends BaseConstraint implements ConstraintInterface * * @return JsonPointer; */ - protected function incrementPath(?JsonPointer $path = null, $i) + protected function incrementPath(?JsonPointer $path, $i) { $path = $path ?: new JsonPointer(''); diff --git a/src/JsonSchema/Constraints/ConstraintInterface.php b/src/JsonSchema/Constraints/ConstraintInterface.php index 92d1d6c3..a5a235ad 100644 --- a/src/JsonSchema/Constraints/ConstraintInterface.php +++ b/src/JsonSchema/Constraints/ConstraintInterface.php @@ -40,7 +40,7 @@ public function addErrors(array $errors); * @param string $constraint the constraint/rule that is broken, e.g.: 'minLength' * @param array $more more array elements to add to the error */ - public function addError(?JsonPointer $path = null, $message, $constraint='', array $more = null); + public function addError(?JsonPointer $path, $message, $constraint='', ?array $more = null); /** * checks if the validator has not raised errors diff --git a/src/JsonSchema/Constraints/ObjectConstraint.php b/src/JsonSchema/Constraints/ObjectConstraint.php index 67b54233..e99c44bc 100644 --- a/src/JsonSchema/Constraints/ObjectConstraint.php +++ b/src/JsonSchema/Constraints/ObjectConstraint.php @@ -51,7 +51,7 @@ public function check(&$element, $schema = null, ?JsonPointer $path = null, $pro $this->validateElement($element, $matches, $schema, $path, $properties, $additionalProp); } - public function validatePatternProperties($element, ?JsonPointer $path = null, $patternProperties) + public function validatePatternProperties($element, ?JsonPointer $path, $patternProperties) { $try = array('/', '#', '+', '~', '%'); $matches = array();