From e272c9d7cef9eeeb98b8014e23ba7860ab17933c Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 28 Oct 2022 16:16:24 +0200 Subject: [PATCH] fix warning (#59) * fix warning * allow infection plugin --- composer.json | 5 +++++ src/Registry/SchemaRegistry.php | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7092ac5..5d253cc 100644 --- a/composer.json +++ b/composer.json @@ -34,5 +34,10 @@ "branch-alias": { "dev-main": "3.0-dev" } + }, + "config": { + "allow-plugins": { + "infection/extension-installer": true + } } } diff --git a/src/Registry/SchemaRegistry.php b/src/Registry/SchemaRegistry.php index e9c3aef..e961b56 100644 --- a/src/Registry/SchemaRegistry.php +++ b/src/Registry/SchemaRegistry.php @@ -135,7 +135,11 @@ private function registerSchemaFile(\SplFileInfo $fileInfo): void } $schemaData = json_decode($fileContent, true, JSON_THROW_ON_ERROR); - $namespace = $schemaData['namespace'] ?? ''; + $namespace = ''; + + if (true === isset($schemaData['namespace'])) { + $namespace = $schemaData['namespace']; + } if (null === $schemaData) { throw new SchemaRegistryException(sprintf(SchemaRegistryException::FILE_INVALID, $fileName));