- Removing annotations replaced by attributes

This commit is contained in:
Dave M. 2023-11-03 19:54:44 -04:00
parent dd0f0271a6
commit 767152e0c3
1 changed files with 4 additions and 1 deletions

View File

@ -85,7 +85,6 @@ class ObjectResolver {
foreach ($property['tags'] as $item) { foreach ($property['tags'] as $item) {
if ($item['object'] instanceof $class) { if ($item['object'] instanceof $class) {
$list[$property['name']] ??= []; $list[$property['name']] ??= [];
$list[$property['name']][] = $this->instanciateAnnotationObject($item); $list[$property['name']][] = $this->instanciateAnnotationObject($item);
} }
} }
@ -216,6 +215,10 @@ class ObjectResolver {
$obj->$key = $value; $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; return $obj;
} }