diff --git a/lib/php/Converter.php b/lib/php/Converter.php index b9dcca8..d8cbf1f 100644 --- a/lib/php/Converter.php +++ b/lib/php/Converter.php @@ -82,9 +82,9 @@ class Converter /** @var array> */ private array $schema_patterns; /** @var array> */ - private array $extra_properties; + private array $extra_properties = []; /** @var array>> */ - private array $extra_sub_properties; + private array $extra_sub_properties = []; /** * @var array> @@ -114,7 +114,7 @@ class Converter * * @param ?float $target_version JSON schema based version to target. Use last version if null. */ - public function __construct(float $target_version = null) + public function __construct($target_version = null) { if ($target_version === null) { $target_version = self::LAST_VERSION; @@ -264,11 +264,11 @@ public function buildSchema() /** * Do validation (against last schema only!) * - * @param array $json Converted data to validate + * @param mixed $json Converted data to validate * * @return boolean */ - public function validate(array $json): bool + public function validate($json): bool { try { $schema = Schema::import($this->buildSchema()); diff --git a/tests/Glpi/Inventory/tests/units/Converter.php b/tests/Glpi/Inventory/tests/units/Converter.php index b8e7d57..1f78eb1 100644 --- a/tests/Glpi/Inventory/tests/units/Converter.php +++ b/tests/Glpi/Inventory/tests/units/Converter.php @@ -98,7 +98,7 @@ public function testGetMethods() * * @return array */ - public static function valuesToCastProvider() + public static function valuesToCastProvider(): array { return [ //true real values