From f408d341cf1f4175ddeccd89e3be8545ed89df96 Mon Sep 17 00:00:00 2001 From: "DESKTOP-Q2AE041\\PCUser" Date: Tue, 30 Jan 2024 21:24:15 +0900 Subject: [PATCH] Fix "Undefined array key 1" when the property has no doc. --- src/Base/Objects/ApiObject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Base/Objects/ApiObject.php b/src/Base/Objects/ApiObject.php index 7790377..98d45e0 100644 --- a/src/Base/Objects/ApiObject.php +++ b/src/Base/Objects/ApiObject.php @@ -164,7 +164,7 @@ public static function getPropertyDataType(\ReflectionProperty $property): ?stdC preg_match('/@var\s+(\w+)(\[])?/', $property->getDocComment(), $matches); - $o->class = $matches[1]; + $o->class = isset($matches[1]) ? $matches[1] : null; $o->isArray = isset($matches[2]); if ($o->class == null)