Skip to content

Remove compiler pass #771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

murtukov
Copy link
Contributor

@murtukov murtukov commented Nov 2, 2020

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Documented? no

This compiler pass finds all services tagged with overblog_graphql.definition_config_processor and injects them into the ConfigProcessor service. The same thing can be done with the !tagged_iterator flag, so it's not necessary to do it manually. This PR removes the ConfigProcessorPass:

class ConfigProcessorPass implements CompilerPassInterface	
{	
    public function process(ContainerBuilder $container): void	
    {	
        $definition = $container->findDefinition(ConfigProcessor::class);	

        $taggedServices = $container->findTaggedServiceIds('overblog_graphql.definition_config_processor');	

        $arguments = [];	
        foreach ($taggedServices as $id => $tags) {	
            $arguments[] = new Reference($id);	
        }	

        $definition->setArgument('$processors', $arguments);	
    }	
}

@murtukov murtukov requested review from akomm and mcg-web November 2, 2020 20:41
@murtukov murtukov changed the title Remove config pass Remove compiler pass Nov 3, 2020
@mcg-web mcg-web merged commit 079cdae into overblog:master Nov 3, 2020
@murtukov murtukov deleted the refactor/remove-unnecessary-config-pass branch November 3, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants