src/Valkyrja/Events/NativeEvents.php
protected function setupAnnotations(): void
    {
        /** @var ListenerAnnotations $containerAnnotations */
        $containerAnnotations = $this->app->container()->getSingleton(
            ListenerAnnotations::class
        );

        // Get all the annotated listeners from the list of classes
        $listeners = $containerAnnotations->getListeners(
            ...$this->app->config()['events']['classes']
        );

        // Iterate through the listeners
        foreach ($listeners as $listener) {
            // Set the service
            $this->listen($listener->getEvent(), $listener);
        }
    }
protected function setupAnnotations(): void
    {
        /** @var ListenerAnnotations $containerAnnotations */
        $containerAnnotations = $this->app->container()->getSingleton(
            ListenerAnnotations::class
        );

        // Get all the annotated listeners from the list of classes
        $listeners = $containerAnnotations->getListeners(
            ...$this->app->config()['events']['classes']
        );

        // Iterate through the listeners
        foreach ($listeners as $listener) {
            // Set the service
            $this->listen($listener->getEvent(), $listener);
        }
    }
Setup annotations.

@throws \Valkyrja\Dispatcher\Exceptions\InvalidClosureException
@throws \Valkyrja\Dispatcher\Exceptions\InvalidDispatchCapabilityException
@throws \Valkyrja\Dispatcher\Exceptions\InvalidFunctionException
@throws \Valkyrja\Dispatcher\Exceptions\InvalidMethodException
@throws \Valkyrja\Dispatcher\Exceptions\InvalidPropertyException

@return void