From 38fad74604f52f1aee68bc844c5ce86ee7cf14e6 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Mon, 3 May 2021 10:47:00 +0200 Subject: [PATCH] Make sure items property is a schema --- src/Generator/Schema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generator/Schema.php b/src/Generator/Schema.php index d76cb44..325f2e3 100644 --- a/src/Generator/Schema.php +++ b/src/Generator/Schema.php @@ -76,7 +76,7 @@ public static function generate(string $name, string $namespace, string $classNa ) ); if (is_string($property->type)) { - if ($property->type === 'array' && array_key_exists(spl_object_hash($property->items), $schemaClassNameMap)) { + if ($property->type === 'array' && $property->items instanceof OpenAPiSchema && array_key_exists(spl_object_hash($property->items), $schemaClassNameMap)) { $docBlock[] = '@var array<' . $namespace . '\\' . $schemaClassNameMap[spl_object_hash($property->items)] . '>'; } $propertyStmt->setType(str_replace([