Skip to content

Commit

Permalink
Merge pull request #18 from arnedesmedt/feature/php8.4-remove-depreca…
Browse files Browse the repository at this point in the history
…tions

Remove php8.4 depreactions
  • Loading branch information
arnedesmedt authored Jan 17, 2025
2 parents 9f7af1e + 652a590 commit 51ce1a5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/JsonSchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ public static function object(array $requiredProps, array $optionalProps = [], $
return new ObjectType($requiredProps, $optionalProps, $additionalProperties);
}

public static function array(Type $itemSchema, array $validation = null): ArrayType
public static function array(Type $itemSchema, ?array $validation = null): ArrayType
{
return new ArrayType($itemSchema, $validation);
}

public static function string(array $validation = null): StringType
public static function string(?array $validation = null): StringType
{
return new StringType($validation);
}
Expand All @@ -92,12 +92,12 @@ public static function uuid(): UuidType
return new UuidType();
}

public static function integer(array $validation = null): IntType
public static function integer(?array $validation = null): IntType
{
return new IntType($validation);
}

public static function float(array $validation = null): FloatType
public static function float(?array $validation = null): FloatType
{
return new FloatType($validation);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Type/ArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class ArrayType implements AnnotatedType, PayloadSchema
*/
private $validation;

public function __construct(TypeSchema $itemSchema, array $validation = null)
public function __construct(TypeSchema $itemSchema, ?array $validation = null)
{
$this->itemSchema = $itemSchema;
$this->validation = $validation;
Expand Down
2 changes: 1 addition & 1 deletion src/Type/FloatType.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class FloatType implements AnnotatedType
*/
private $validation;

public function __construct(array $validation = null)
public function __construct(?array $validation = null)
{
$this->validation = $validation;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Type/IntType.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class IntType implements AnnotatedType
*/
private $validation;

public function __construct(array $validation = null)
public function __construct(?array $validation = null)
{
$this->validation = $validation;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Type/StringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class StringType implements AnnotatedType
*/
private $validation = [];

public function __construct(array $validation = null)
public function __construct(?array $validation = null)
{
$this->validation = (array) $validation;
}
Expand Down

0 comments on commit 51ce1a5

Please sign in to comment.