From 767152e0c31555dc0d26bbd1627b871caa0091ea Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Fri, 3 Nov 2023 19:54:44 -0400 Subject: [PATCH] - Removing annotations replaced by attributes --- src/ObjectResolver.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ObjectResolver.php b/src/ObjectResolver.php index 38beaf0..9333adb 100644 --- a/src/ObjectResolver.php +++ b/src/ObjectResolver.php @@ -85,7 +85,6 @@ class ObjectResolver { foreach ($property['tags'] as $item) { if ($item['object'] instanceof $class) { $list[$property['name']] ??= []; - $list[$property['name']][] = $this->instanciateAnnotationObject($item); } } @@ -216,6 +215,10 @@ class ObjectResolver { $obj->$key = $value; } + if ( ! $obj instanceof \Notes\Attribute ) { + throw new \RuntimeException(sprintf("An error occurred trying to retrieve an Attribute def:%s from class %s", json_encode($tagDefinition), $this->objectClass)); + } + return $obj; }