示例#1
0
 /**
  * You can modify the container here before it is dumped to PHP code.
  *
  * @param ContainerBuilder $container
  *
  * @api
  */
 public function process(ContainerBuilder $container)
 {
     $definition = $container->getDefinition(CliExtension::CONTROLLER_TAG . '.order');
     $references = $this->processor->findAndSortTaggedServices($container, self::ORDERER_TAG);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerOrderer', array($reference));
     }
 }
 /**
  * Registers all available event subscribers.
  *
  * @param ContainerBuilder $container
  */
 protected function processSubscribers(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::SUBSCRIBER_TAG);
     $definition = $container->getDefinition(self::DISPATCHER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('addSubscriber', array($reference));
     }
 }
示例#3
0
 /**
  * Processes all registered result interpretations.
  *
  * @param ContainerBuilder $container
  */
 protected function processResultInterpretations(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::RESULT_INTERPRETATION_TAG);
     $definition = $container->getDefinition(self::RESULT_INTERPRETER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerResultInterpretation', array($reference));
     }
 }
 /**
  * Processes all environment readers.
  *
  * @param ContainerBuilder $container
  */
 protected function processReaders(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::READER_TAG);
     $definition = $container->getDefinition(self::MANAGER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerEnvironmentReader', array($reference));
     }
 }
示例#5
0
 /**
  * Processes all annotation readers.
  *
  * @param ContainerBuilder $container
  */
 private function processAnnotationReaders(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::ANNOTATION_READER_TAG);
     $definition = $container->getDefinition(self::getAnnotatedContextReaderId());
     foreach ($references as $reference) {
         $definition->addMethodCall('registerAnnotationReader', array($reference));
     }
 }
 /**
  * Processes specification locators.
  *
  * @param ContainerBuilder $container
  */
 private function processLocators(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::LOCATOR_TAG);
     $definition = $container->getDefinition(self::FINDER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerSpecificationLocator', array($reference));
     }
 }
 /**
  * Processes all search engines in the container.
  *
  * @param ContainerBuilder $container
  */
 private function processObjectMapperRegistration(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, Extension::OBJECT_MAPPER_REGISTRATION_TAG);
     $definition = $container->getDefinition(Extension::MAPPER_COLLECTION_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('add', array($reference));
     }
 }
 /**
  * Processes all pattern policies.
  *
  * @param ContainerBuilder $container
  */
 private function processPatternPolicies(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::PATTERN_POLICY_TAG);
     $definition = $container->getDefinition(self::PATTERN_TRANSFORMER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerPatternPolicy', array($reference));
     }
 }
示例#9
0
 /**
  * Processes suite setups.
  *
  * @param ContainerBuilder $container
  */
 private function processSetups(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::SETUP_TAG);
     $definition = $container->getDefinition(self::BOOTSTRAPPER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerSuiteSetup', array($reference));
     }
 }
 /**
  * Processes all search engines in the container.
  *
  * @param ContainerBuilder $container
  */
 private function processTerminalFactoryRegistration(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::TERMINAL_FACTORY_TAG);
     $definition = $container->getDefinition(Extension::TERMINAL_COLLECTION_FACTORY_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerTerminalFactory', array($reference));
     }
 }
示例#11
0
 /**
  * @param ContainerBuilder $container
  */
 protected function processAppenders(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::APPENDER_TAG);
     $definition = $container->getDefinition(self::WRITER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerSnippetAppender', array($reference));
     }
 }
示例#12
0
 /**
  * Processes all available gherkin loaders.
  *
  * @param ContainerBuilder $container
  */
 private function processLoaders(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::LOADER_TAG);
     $definition = $container->getDefinition(self::MANAGER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('addLoader', array($reference));
     }
 }
示例#13
0
 /**
  * Processes all available exception stringers.
  *
  * @param ContainerBuilder $container
  */
 protected function processStringers(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::STRINGER_TAG);
     $definition = $container->getDefinition(self::PRESENTER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerExceptionStringer', array($reference));
     }
 }
示例#14
0
 /**
  * Registers all call result filters to the CallCenter.
  *
  * @param ContainerBuilder $container
  */
 protected function processResultFilters(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, CallExtension::RESULT_FILTER_TAG);
     $definition = $container->getDefinition(CallExtension::CALL_CENTER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerResultFilter', array($reference));
     }
 }
 /**
  * Processes all available argument transformers.
  *
  * @param ContainerBuilder $container
  */
 protected function processArgumentsTransformers(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::ARGUMENT_TRANSFORMER_TAG);
     $definition = $container->getDefinition($this->getDefinitionArgumentTransformerId());
     foreach ($references as $reference) {
         $definition->addMethodCall('registerArgumentTransformer', array($reference));
     }
 }
示例#16
0
 /**
  * Registers all exception handlers to the CallCenter.
  *
  * @param ContainerBuilder $container
  */
 private function processExceptionHandlers(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, CallExtension::EXCEPTION_HANDLER_TAG);
     $definition = $container->getDefinition(CallExtension::CALL_CENTER_ID);
     foreach ($references as $reference) {
         $definition->addMethodCall('registerExceptionHandler', array($reference));
     }
 }
 /**
  * Process the Environment Reader pass.
  */
 private function processEnvironmentReaderPass(ContainerBuilder $container)
 {
     // Register Behat context readers.
     $references = $this->processor->findAndSortTaggedServices($container, ContextExtension::READER_TAG);
     $definition = $container->getDefinition('drupal.context.environment.reader');
     foreach ($references as $reference) {
         $definition->addMethodCall('registerContextReader', array($reference));
     }
 }
示例#18
0
 /**
  * Processes all available output formatters.
  *
  * @param ContainerBuilder $container
  */
 private function processDynamicallyRegisteredFormatters(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::FORMATTER_TAG);
     $definition = $container->getDefinition(self::MANAGER_ID);
     $previousCalls = $definition->getMethodCalls();
     $definition->setMethodCalls();
     foreach ($references as $reference) {
         $definition->addMethodCall('registerFormatter', array($reference));
     }
     foreach ($previousCalls as $call) {
         $definition->addMethodCall($call[0], $call[1]);
     }
 }
示例#19
0
 /**
  * Processes all registered step tester wrappers.
  *
  * @param ContainerBuilder $container
  */
 protected function processStepTesterWrappers(ContainerBuilder $container)
 {
     $this->processor->processWrapperServices($container, self::STEP_TESTER_ID, self::STEP_TESTER_WRAPPER_TAG);
 }
 /**
  * Processes all registered pretty formatter node listener wrappers.
  *
  * @param ContainerBuilder $container
  */
 protected function processListenerWrappers(ContainerBuilder $container)
 {
     $this->processor->processWrapperServices($container, self::ROOT_LISTENER_ID, self::ROOT_LISTENER_WRAPPER_TAG);
 }
示例#21
0
 /**
  * Processes all controllers in container.
  *
  * @param ContainerBuilder $container
  */
 protected function processControllers(ContainerBuilder $container)
 {
     $references = $this->processor->findAndSortTaggedServices($container, self::CONTROLLER_TAG);
     $container->getDefinition(self::COMMAND_ID)->replaceArgument(1, $references);
 }
示例#22
0
 /**
  * {@inheritDoc}
  *
  * @see EnvironmentExtension::getEnvironmentReaderId()
  */
 public function process(ContainerBuilder $container)
 {
     $this->setDefinition($container, 'TqContextReader', EnvironmentExtension::READER_TAG . '.context', [$this->processor->findAndSortTaggedServices($container, ContextExtension::READER_TAG)]);
 }