Skip to content

Commit 8de38ef

Browse files
authored
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"
1 parent 7b93c1f commit 8de38ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bundles/extension.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ method to return the instance of the extension::
5454

5555
// ...
5656
use Acme\HelloBundle\DependencyInjection\UnconventionalExtensionClass;
57+
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
5758

5859
class AcmeHelloBundle extends Bundle
5960
{
60-
public function getContainerExtension()
61+
public function getContainerExtension(): ?ExtensionInterface
6162
{
6263
return new UnconventionalExtensionClass();
6364
}

0 commit comments

Comments
 (0)