AddValidatorInitializersPass example

->addTag('validator.initializer')
        ;
        $container
            ->register('initializer2')
            ->addTag('validator.initializer')
        ;
        $container
            ->register('validator.builder')
            ->addArgument([])
        ;

        (new AddValidatorInitializersPass())->process($container);

        $this->assertEquals(
            [['addObjectInitializers', [[new Reference('initializer1')new Reference('initializer2')]]]],
            $container->getDefinition('validator.builder')->getMethodCalls()
        );
    }
}
Home | Imprint | This part of the site doesn't use cookies.