Skip to content

Commit

Permalink
Merge pull request #11 from hackoh/fix-property-doc
Browse files Browse the repository at this point in the history
Fix "Undefined array key 1" when the property has no doc.
  • Loading branch information
dolejska-daniel committed Jan 30, 2024
2 parents 1e3fc01 + f408d34 commit cf60a8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Base/Objects/ApiObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cf60a8f

Please sign in to comment.