Skip to content

Commit 8ee9da6

Browse files
committed
minor #17653 Update getContainerExtension() (raphaelriehl)
This PR was merged into the 6.0 branch. Discussion ---------- 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 : ```php Declaration of Acme\TestBundle\AcmeTestBundle::getContainerExtension() must be compatible with Symfony\Component\HttpKernel\Bundle\Bundle::getContainerExtension(): ?Symfony\Component\DependencyInjection\Extension\ExtensionInterface ``` <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- 8de38ef Update getContainerExtension()
2 parents 662fcbf + 8de38ef commit 8ee9da6

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)