From 8c26159af52678b427dc2807a98ca104bc841a1f Mon Sep 17 00:00:00 2001 From: tbl0605 Date: Mon, 8 Jun 2026 11:02:34 +0200 Subject: [PATCH] PHP 8.4 compatibility fixes --- src/JSONSchemaGenerator/Generator.php | 4 ++-- src/JSONSchemaGenerator/Parsers/BaseParser.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/JSONSchemaGenerator/Generator.php b/src/JSONSchemaGenerator/Generator.php index 309b22b..708494a 100644 --- a/src/JSONSchemaGenerator/Generator.php +++ b/src/JSONSchemaGenerator/Generator.php @@ -26,7 +26,7 @@ abstract class Generator * @return string * @throws \JSONSchemaGenerator\Parsers\Exceptions\UnmappableException */ - public static function from($object, array $config = null): string + public static function from($object, ?array $config = null): string { return (new BaseParser($config))->parse($object)->json(); } @@ -38,7 +38,7 @@ public static function from($object, array $config = null): string * @return string * @throws \JSONSchemaGenerator\Parsers\Exceptions\UnmappableException */ - public static function fromJson(string $jsonString, array $config = null): string + public static function fromJson(string $jsonString, ?array $config = null): string { return (new BaseParser($config))->parse(json_decode($jsonString))->json(); } diff --git a/src/JSONSchemaGenerator/Parsers/BaseParser.php b/src/JSONSchemaGenerator/Parsers/BaseParser.php index 87a1601..a88236c 100644 --- a/src/JSONSchemaGenerator/Parsers/BaseParser.php +++ b/src/JSONSchemaGenerator/Parsers/BaseParser.php @@ -42,7 +42,7 @@ class BaseParser /** * @param array|null $config */ - public function __construct(array $config = null) + public function __construct(?array $config = null) { $this->config = array_merge([ 'schema_id' => null,