Skip to content

Conversation

@MatTheCat
Copy link
Contributor

Following #20365 (comment)

@carsonbot carsonbot added this to the 6.4 milestone Dec 17, 2025
@carsonbot carsonbot changed the title Remove mention of CompilerPassInterface support for bundles Remove mention of CompilerPassInterface support for bundles Dec 17, 2025
@yceruto
Copy link
Member

yceruto commented Dec 17, 2025

Thinking a bit more about it, maybe it's not necessary to remove this documentation. Instead, we can just add a few lines to make it work:

class MyBundle extends AbstractBundle implements CompilerPassInterface
    {
        public function process(ContainerBuilder $container): void
        {
             // ...
        }
 
        public function build(ContainerBuilder $container): void 
        {
            $container->addCompilerPass($this); // self-registration
        }
    }

Then, in 8.1 we can just remove the build() method. What do you think?

@MatTheCat
Copy link
Contributor Author

Ah didn’t even think about this; but yes this feels like a pretty good alternative 👍

@MatTheCat MatTheCat force-pushed the bundle_compiler_pass_interface branch from f367350 to f4cc93c Compare December 17, 2025 12:35
@MatTheCat MatTheCat changed the title Remove mention of CompilerPassInterface support for bundles Fix mention of CompilerPassInterface support for bundles Dec 17, 2025
@MatTheCat
Copy link
Contributor Author

PR updated. Not sure about the call to parent::build() though: I don’t think it is required?

@yceruto
Copy link
Member

yceruto commented Dec 17, 2025

parent::build($container);

it's not required, you can safely remove it

@MatTheCat MatTheCat force-pushed the bundle_compiler_pass_interface branch from f4cc93c to d4bfcb2 Compare December 17, 2025 13:47
Copy link
Member

@yceruto yceruto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants