From 5ab5d449ab8850cb84a1f38341f4b42c5b35fd34 Mon Sep 17 00:00:00 2001 From: Brent Roose Date: Thu, 2 May 2024 14:17:48 +0200 Subject: [PATCH] Attributes function --- src/functions.php | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); + } }