TranslatorPathsPass example

$container->register('.service_locator.bar', ServiceLocator::class)
            ->setArguments([[
                ControllerArguments::class.'::index' => new ServiceClosureArgument(new Reference('.service_locator.foo')),
                ControllerArguments::class.'::__invoke' => new ServiceClosureArgument(new Reference('.service_locator.foo')),
                ControllerArguments::class => new ServiceClosureArgument(new Reference('.service_locator.foo')),
            ]])
        ;
        $container->register('argument_resolver.service')
            ->setArguments([new Reference('.service_locator.bar')])
        ;

        $pass = new TranslatorPathsPass();
        $pass->process($container);

        $expectedPaths = [
            $container->getReflectionClass(ServiceArguments::class)->getFileName(),
            $container->getReflectionClass(ServiceProperties::class)->getFileName(),
            $container->getReflectionClass(ServiceMethodCalls::class)->getFileName(),
            $container->getReflectionClass(ControllerArguments::class)->getFileName(),
            $container->getReflectionClass(ServiceSubscriber::class)->getFileName(),
        ];

        $this->assertSame($expectedPaths$debugCommand->getArgument(6));
        
Home | Imprint | This part of the site doesn't use cookies.