From 2a00b0bc94c5148af0366a873588294c85373648 Mon Sep 17 00:00:00 2001 From: Nick Chiu Date: Mon, 4 Apr 2022 15:39:31 +0200 Subject: [PATCH] fix stan --- src/Registry/SchemaRegistry.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Registry/SchemaRegistry.php b/src/Registry/SchemaRegistry.php index e9c3aef..ca4ec1b 100644 --- a/src/Registry/SchemaRegistry.php +++ b/src/Registry/SchemaRegistry.php @@ -135,7 +135,7 @@ private function registerSchemaFile(\SplFileInfo $fileInfo): void } $schemaData = json_decode($fileContent, true, JSON_THROW_ON_ERROR); - $namespace = $schemaData['namespace'] ?? ''; + $namespace = (string) $schemaData['namespace']; if (null === $schemaData) { throw new SchemaRegistryException(sprintf(SchemaRegistryException::FILE_INVALID, $fileName)); @@ -150,7 +150,7 @@ private function registerSchemaFile(\SplFileInfo $fileInfo): void $this->schemas[$schemaId] = $template->withSchemaId($schemaId); if (true === isset($schemaData['name'])) { - $this->schemaNamesPerNamespace[$namespace][] = $schemaData['name']; + $this->schemaNamesPerNamespace[$namespace][] = (string) $schemaData['name']; } }