Returns the compiler pass config which can then be modified.
public getCompilerPassConfig ( ) : |
||
return | The compiler pass config |
use Symfony\Component\DependencyInjection\ContainerBuilder; $containerBuilder = new ContainerBuilder(); $compilerPassConfig = $containerBuilder->getCompilerPassConfig();
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\PassConfig; $containerBuilder = new ContainerBuilder(); $compilerPassConfig = new PassConfig(PassConfig::TYPE_BEFORE_REMOVING); $containerBuilder->addCompilerPass(new MyCompilerPass(), $compilerPassConfig);In this example, we first import the PassConfig class from the Symfony\Component\DependencyInjection\Compiler package. We then create a new instance of the ContainerBuilder class and assign it to a variable called $containerBuilder. We also create a new instance of the PassConfig class and pass in the TYPE_BEFORE_REMOVING constant as a parameter. We then use the addCompilerPass method to add a new Compiler Pass to the container, passing in a new instance of the MyCompilerPass class and the $compilerPassConfig variable as parameters. Overall, these examples demonstrate how the ContainerBuilder getCompilerPassConfig method is used in conjunction with other classes and methods to build and manage dependency injection containers in PHP.
public getCompilerPassConfig ( ) : |
||
return | The compiler pass config |