Lets say I have the following attribute declaration
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
class Route
{
public function __construct(
public string $path,
public ?string $method = null,
public ?string $alias = null
)
{}
}
and I use it in some controller methods like so:
class Controller
{
#[Route('/index/')]
#[Route('/home/', alias: 'home')]
public function index()
{
...
}
#[Route('/create/', 'POST')]
public function create(Request $request)
{
//...
}
}
How could I obtain those attribute instances and read it's properties?