src/Valkyrja/Container/NativeContainer.php
protected function setupAnnotations(): void
    {
        /** @var ContainerAnnotations $containerAnnotations */
        $containerAnnotations = $this->getSingleton(
            ContainerAnnotations::class
        );

        // Get all the annotated services from the list of controllers
        $services = $containerAnnotations->getServices(
            ...$this->app->config()['container']['services']
        );

        // Iterate through the services
        foreach ($services as $service) {
            // Set the service
            $this->bind($service);
        }

        // Get all the annotated services from the list of controllers
        $contextServices = $containerAnnotations->getContextServices(
            ...$this->app->config()['container']['contextServices']
        );

        // Iterate through the services
        foreach ($contextServices as $context) {
            // Set the service
            $this->context($context);
        }

        // Get all the annotated services from the list of classes
        $aliasServices = $containerAnnotations->getAliasServices(
            ...$this->app->config()['container']['services']
        );

        // Iterate through the services
        foreach ($aliasServices as $alias) {
            // Set the service
            $this->alias($alias->getName(), $alias->getId());
        }
    }
protected function setupAnnotations(): void
    {
        /** @var ContainerAnnotations $containerAnnotations */
        $containerAnnotations = $this->getSingleton(
            ContainerAnnotations::class
        );

        // Get all the annotated services from the list of controllers
        $services = $containerAnnotations->getServices(
            ...$this->app->config()['container']['services']
        );

        // Iterate through the services
        foreach ($services as $service) {
            // Set the service
            $this->bind($service);
        }

        // Get all the annotated services from the list of controllers
        $contextServices = $containerAnnotations->getContextServices(
            ...$this->app->config()['container']['contextServices']
        );

        // Iterate through the services
        foreach ($contextServices as $context) {
            // Set the service
            $this->context($context);
        }

        // Get all the annotated services from the list of classes
        $aliasServices = $containerAnnotations->getAliasServices(
            ...$this->app->config()['container']['services']
        );

        // Iterate through the services
        foreach ($aliasServices as $alias) {
            // Set the service
            $this->alias($alias->getName(), $alias->getId());
        }
    }
Setup annotations.

@throws \Valkyrja\Container\Exceptions\InvalidContextException
@throws \Valkyrja\Container\Exceptions\EndlessContextLoopException
@throws \Valkyrja\Container\Exceptions\InvalidServiceIdException
@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