diff --git a/src/functions.php b/src/functions.php index ba08697..e31481a 100644 --- a/src/functions.php +++ b/src/functions.php @@ -6,6 +6,7 @@ { use Tempest\Container\GenericContainer; use Tempest\Events\EventBus; + use Tempest\Support\Reflection\Attributes; /** * @template TClassName @@ -25,4 +26,14 @@ function event(object $event): void $eventBus->dispatch($event); } + + /** + * @template T of object + * @param class-string $attributeName + * @return \Tempest\Support\Reflection\Attributes + */ + function attribute(string $attributeName): Attributes + { + return Attributes::find($attributeName); + } }