Skip to content

Commit

Permalink
Fix more deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jul 6, 2024
1 parent 00fbffd commit feb2ca6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/JsonSchema/Constraints/BaseConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('')),
Expand Down
2 changes: 1 addition & 1 deletion src/JsonSchema/Constraints/Constraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('');

Expand Down
2 changes: 1 addition & 1 deletion src/JsonSchema/Constraints/ConstraintInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/JsonSchema/Constraints/ObjectConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit feb2ca6

Please sign in to comment.