enableExpressionProcessing example

private bool $byFactory;
    private array $definitions;
    private array $aliases;

    /** * @param bool $onlyConstructorArguments Sets this Service Reference pass to ignore method calls */
    public function __construct(bool $onlyConstructorArguments = false, bool $hasProxyDumper = true)
    {
        $this->onlyConstructorArguments = $onlyConstructorArguments;
        $this->hasProxyDumper = $hasProxyDumper;
        $this->enableExpressionProcessing();
    }

    /** * Processes a ContainerBuilder object to populate the service reference graph. * * @return void */
    public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        $this->graph = $container->getCompiler()->getServiceReferenceGraph();
        
private array $connectedIds = [];

    /** * Processes the ContainerBuilder to remove unused definitions. * * @return void */
    public function process(ContainerBuilder $container)
    {
        try {
            $this->enableExpressionProcessing();
            $this->container = $container;
            $connectedIds = [];
            $aliases = $container->getAliases();

            foreach ($aliases as $id => $alias) {
                if ($alias->isPublic()) {
                    $this->connectedIds[] = (string) $aliases[$id];
                }
            }

            foreach ($container->getDefinitions() as $id => $definition) {
                

    private array $connectedIds = [];

    /** * Processes the ContainerBuilder to remove unused definitions. * * @return void */
    public function process(ContainerBuilder $container)
    {
        try {
            $this->enableExpressionProcessing();
            $this->container = $container;
            $connectedIds = [];
            $aliases = $container->getAliases();

            foreach ($aliases as $id => $alias) {
                if ($alias->isPublic()) {
                    $this->connectedIds[] = (string) $aliases[$id];
                }
            }

            foreach ($container->getDefinitions() as $id => $definition) {
                
private bool $byFactory;
    private array $definitions;
    private array $aliases;

    /** * @param bool $onlyConstructorArguments Sets this Service Reference pass to ignore method calls */
    public function __construct(bool $onlyConstructorArguments = false, bool $hasProxyDumper = true)
    {
        $this->onlyConstructorArguments = $onlyConstructorArguments;
        $this->hasProxyDumper = $hasProxyDumper;
        $this->enableExpressionProcessing();
    }

    /** * Processes a ContainerBuilder object to populate the service reference graph. * * @return void */
    public function process(ContainerBuilder $container)
    {
        $this->container = $container;
        $this->graph = $container->getCompiler()->getServiceReferenceGraph();
        
Home | Imprint | This part of the site doesn't use cookies.