@param AnnotationRegistration $registration

@return ServiceActivatorBuilder
@throws InvalidArgumentException
@throws \Doctrine\Common\Annotations\AnnotationException
@throws \ReflectionException
@throws \SimplyCodedSoftware\Messaging\MessagingException
429248
private function createServiceActivator(AnnotationRegistration $registration): ServiceActivatorBuilder
    {
        $inputChannelName = self::getMessageChannelFor($registration);
        $annotation = $registration->getAnnotationForMethod();

        $relatedClassInterface         = InterfaceToCall::create($registration->getClassName(), $registration->getMethodName());
        $parameterConverterAnnotations = $annotation->parameterConverters;
        $parameterConverters           = $this->getParameterConverters($relatedClassInterface, $parameterConverterAnnotations);

        $messageHandlerBuilder = ServiceActivatorBuilder::create($registration->getReferenceName(), $registration->getMethodName())
            ->withInputChannelName($inputChannelName)
            ->withEndpointId($annotation->endpointId)
            ->withMethodParameterConverters($parameterConverters);

        return $messageHandlerBuilder;
}
1182861
public function process(ContainerBuilder $container)
    {
        $serviceName = $container->getParameter('o_auth2_server.user_provider');

        if ($container->hasAlias($serviceName)) {
            $serviceName = (string) $container->getAlias($serviceName); // to service id
        }

        if (!$container->hasDefinition($serviceName)) {
            throw new InvalidConfigurationException("Service or alias '$serviceName' does not exist.");
        }

        $service = $container->getDefinition($serviceName);

        if (!is_subclass_of($service->getClass(), 'Symfony\\Component\\Security\\Core\\User\\UserProviderInterface')) {
            throw new InvalidConfigurationException(
                "Service '$serviceName' has to implement Symfony\\Component\\Security\\Core\\User\\UserProviderInterface."
            );
        }

        $container->setAlias('o_auth2_server.user_provider', $serviceName);
    }
57230
public function register()
    {
        $this->getContainer()->singleton(Annotation::class, function() {
            Annotation::setContainer($this->getContainer());

            $annotation =  new Annotation((new Parser())->skipPhpDoc());

            return $annotation->addCommand(new Inject())
                ->addCommand(new Provider());
        });
    }
372015
public static function registerAllExtensions(\Protobuf\Extension\ExtensionRegistry $registry)
    {
        $registry->add(self::package());
        $registry->add(self::genericServices());
    }
1061348
public static function objects(Registry $registry = null)
    {
        $manager = static::getManagerClass();
        $modelInstance = static::createObject(['registry' => $registry]);

        return new $manager($modelInstance);
    }
106135
public function setAnnotationManager(AnnotationManager $annotationManager)
    {
        $parser = new Parser\DoctrineAnnotationParser();
        foreach ($this->defaultAnnotations as $annotationName) {
            $class = __NAMESPACE__ . '\\' . $annotationName;
            $parser->registerAnnotation($class);
        }
        $annotationManager->attach($parser);
        $this->annotationManager = $annotationManager;
        return $this;
    }
347496
@Override
    protected ServiceRegistration<D> addService(S service, ServiceProperties props) {
        D decorator = createDecorator(service, props);
        if (decorator == null) {
            return null;
        }
        Dictionary<String, ?> decoratorServiceProps = decoratorServiceProps(props);
        getLogger().info("Registering decorator service {} with properties {}", decoratorType.getSimpleName(), decoratorServiceProps);
        return getBundleContext().registerService(decoratorType, decorator, decoratorServiceProps);
    }
1110015
private static function getContainerBuilder(Configuration $configuration): DIContainerBuilder
    {
        $containerBuilder = new DIContainerBuilder($configuration->getContainerClass());

        $containerBuilder->useAutowiring($configuration->doesUseAutowiring());
        $containerBuilder->useAnnotations($configuration->doesUseAnnotations());
        $containerBuilder->ignorePhpDocErrors($configuration->doesIgnorePhpDocErrors());

        if ($configuration->doesUseDefinitionCache()) {
            $containerBuilder->enableDefinitionCache();
        }

        if ($configuration->getWrapContainer() !== null) {
            $containerBuilder->wrapContainer($configuration->getWrapContainer());
        }

        if ($configuration->getProxiesPath() !== null) {
            $containerBuilder->writeProxiesToFile(true, $configuration->getProxiesPath());
        }

        if (!empty($configuration->getCompilationPath())) {
            $containerBuilder->enableCompilation(
                $configuration->getCompilationPath(),
                'CompiledContainer',
                $configuration->getCompiledContainerClass()
            );
        }

        return $containerBuilder;
    }
887335
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition(ProviderAggregator::class)) {
            return;
        }

        $providers = [];
        foreach ($container->findTaggedServiceIds('bazinga_geocoder.provider') as $providerId => $attributes) {
            $providers[] = new Reference($providerId);
        }

        $geocoderDefinition = $container->getDefinition(ProviderAggregator::class);
        $geocoderDefinition->addMethodCall('registerProviders', [$providers]);
    }
1318989
public function register(ContainerInterface $container, Configurable $config)
    {
        if (! $config instanceof Config) {
            throw new \InvalidArgumentException('Wrong Config object');
        }

        $logger = new Logger($config->name, $config->handlers);

        $container->add($config->getServiceName(), $logger);
    }
755490
protected <T> RegistrationAnnotatedBindingBuilder<T> register(Class<T> type) {
        return registryBinderImpl.register(type);
    }
557837
public function register(EntityDefinition $builder): void {
    $this->defs[$builder->full_name] = $builder;
    $this->unchecked[] = $builder;

    $binding_name = str_replace('\\', '.', $builder->full_name);
    $this->ioc->bind('bap.remodel.scopes.' . $binding_name, function() use($builder) {
      return $builder->scopes;
    });

    foreach($builder->virtuals as $virtual) {
      $this->ioc->bind("bap.remodel.virtuals.{$binding_name}.{$virtual->alias}", function() use($virtual) {
        return $virtual->callback;
      });
    }

    $this->tailor->bindCallback($builder->full_name, function(Generator $gen) use($builder): void {
      $this->checkDefinitions();

      $file = $gen->generate('Entity', $builder->toArray());
      $gen->includeFile($file);
    });

    foreach(static::CLASS_SUFFIXES as $class) {
      $this->tailor->bindCallback($builder->full_name . $class, function(Generator $gen) use($builder, $class): void {
        $this->checkDefinitions();

        $file = $gen->generate($class, $builder->toArray());
        $gen->includeFile($file);
      });
    }
  }
265403
public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition($this->processorFactoryService) && !$container->hasAlias($this->processorFactoryService)) {
            return;
        }

        $dispatcher = $container->findDefinition($this->processorFactoryService);

        foreach ($container->findTaggedServiceIds($this->listenerTag) as $id => $tags) {
            $def = $container->getDefinition($id);
            $this->assertProcessorDefinition($def, $id);
            foreach ($tags as $attributes) {
                if (empty($attributes['command'])) {
                    throw new InvalidArgumentException(sprintf('The service "%s" is tagged as processor without specifying "command" attribute', $id));
                }
                $dispatcher->addMethodCall('registerProcessorIdForCommand', array(
                    $attributes['command'],
                    $id,
                ));
            }
        }
    }
1019435
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        if ($this->container !== null) {
            return $this->container;
        }

        $builder = new ContainerBuilder();
        $config = $this->getConfig($serviceLocator);
        $configFile = $this->getDefinitionsFilePath($config);
        $builder->addDefinitions($configFile);

        $useAnnotations = $this->shouldUseAnnotations($config);
        $builder->useAnnotations($useAnnotations);

        $acclimator = new ContainerAcclimator();
        $zfContainer = $acclimator->acclimate($serviceLocator);
        $builder->wrapContainer($zfContainer);

        /**
         * @var $cache Cache
         */
        $cache = $this->getCache($serviceLocator, $config);

        if ($cache) {
            $builder->setDefinitionCache($cache);
        }

        $this->container = $builder->build();

        return $this->container;
    }
155752
public function createService(ServiceLocatorInterface $serviceLocator)
    {
        return new AnnotationRouter(
            $serviceLocator->get('TjoAnnotationRouter\Options\Config'),
            $serviceLocator->get('TjoAnnotationRouter\Parser\ControllerParser'),
            new Merger(),
            $serviceLocator->get('ControllerLoader')
        );
    }
334679
private function activate($container, ArrayResolver $serviceConfig, $serviceName)
    {
        $this->typeInitializer->initialize($container, $serviceConfig);

        $activator = $this->activatorFactory->getActivator($serviceName, $serviceConfig);

        return $activator->createInstance($container, $serviceConfig, $serviceName);
    }
1315225
private function registerLocator(
        ContainerBuilder $container,
        EntityMapping $entityMapping
    ) {
        /**
         * Locator.
         */
        $locatorId = 'simple_doctrine_mapping.locator.' . $entityMapping->getUniqueIdentifier();
        $locator = new Definition('Mmoreram\SimpleDoctrineMapping\Locator\SimpleDoctrineMappingLocator');
        $locator->setPublic(false);
        $locator->setArguments([
            $entityMapping->getEntityNamespace(),
            [$entityMapping->getEntityMappingFilePath()],
        ]);
        $locator->setConfigurator([
            new Reference('simple_doctrine_mapping.locator_configurator'),
            'configure',
        ]);
        $container->setDefinition($locatorId, $locator);
    }