- Attached a new exc eption message whenever an attribute is missing

This commit is contained in:
Dave Mc Nicoll 2023-01-26 18:49:30 +00:00
parent 87b9ea2e2a
commit d92bb527da
1 changed files with 10 additions and 5 deletions

View File

@ -40,11 +40,16 @@ class AnnotationReader
if ( $reflect->getAttributes() ) { if ( $reflect->getAttributes() ) {
foreach($reflect->getAttributes() as $attr) { foreach($reflect->getAttributes() as $attr) {
$tags[] = [ try {
'tag' => substr(strrchr($attr->getName(), "\\"), 1), $tags[] = [
'arguments' => $attr->getArguments(), 'tag' => substr(strrchr($attr->getName(), "\\"), 1),
'object' => $attr->newInstance(), 'arguments' => $attr->getArguments(),
]; 'object' => $attr->newInstance(),
];
}
catch(\Throwable $e) {
throw new \Exception(sprintf("%s for %s in file '%s'", $e->getMessage(), $reflect, $this->class));
}
} }
} }
else { else {