Skip to content

fix: add void return type to LimeniusLiformBundle::build() for Symfony 8 - #47

Open
francis-roux-serret wants to merge 1 commit into
Limenius:masterfrom
francis-roux-serret:fix/build-signature-void-return-type
Open

francis-roux-serret wants to merge 1 commit into
Limenius:masterfrom
francis-roux-serret:fix/build-signature-void-return-type

Conversation

@francis-roux-serret

Copy link
Copy Markdown

Problem

Tag 2.1 bumped composer.json to declare Symfony ^8.0 support, but the code change for it wasn't included. On Symfony 8, Symfony\Component\HttpKernel\Bundle\Bundle::build() is typed as : void, so the current signature in LimeniusLiformBundle::build() triggers a fatal compile error when the kernel initializes bundles:

Compile Error: Declaration of Limenius\LiformBundle\LimeniusLiformBundle::build(
    Symfony\Component\DependencyInjection\ContainerBuilder $container
) must be compatible with Symfony\Component\HttpKernel\Bundle\Bundle::build(
    Symfony\Component\DependencyInjection\ContainerBuilder $container
): void

Reproduced on a Symfony 8 / PHP 8.5 project by installing limenius/liform-bundle:^2.1 and running bin/console cache:clear.

Fix

Add : void to LimeniusLiformBundle::build(). This is compatible with Symfony 5.4/6/7 as well (the parent has been : void since Symfony 4.4).

Notes

This is the last remaining piece of Symfony 8 support after #. Nothing else needs to change.

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.

1 participant