From 8de38ef1d6249cd5404a68f6ebc27e761dbe6479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Riehl?= Date: Wed, 4 Jan 2023 14:03:12 +0100 Subject: [PATCH] Update getContainerExtension() Since Symfony 6.x call to getContainerExtension() has evolved. Now, it's necessary to set a return type, else it generates this error : Declaration of Acme\TestBundle\AcmeTestBundle::getContainerExtension() must be compatible with Symfony\Component\HttpKernel\Bundle\Bundle::getContainerExtension(): ?Symfony\Component\DependencyInjection\Extension\ExtensionInterface" --- bundles/extension.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/extension.rst b/bundles/extension.rst index edbcb5cd270..69f34dbc604 100644 --- a/bundles/extension.rst +++ b/bundles/extension.rst @@ -54,10 +54,11 @@ method to return the instance of the extension:: // ... use Acme\HelloBundle\DependencyInjection\UnconventionalExtensionClass; + use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; class AcmeHelloBundle extends Bundle { - public function getContainerExtension() + public function getContainerExtension(): ?ExtensionInterface { return new UnconventionalExtensionClass(); }