Skip to content

Commit

Permalink
Merge branch '7.0' into 7.1
Browse files Browse the repository at this point in the history
* 7.0:
  Extend AbstractBundle instead of Bundle
  • Loading branch information
javiereguiluz committed May 13, 2024
2 parents f35eec7 + 353f47a commit b7719c1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 13 additions & 7 deletions bundles/best_practices.rst
Expand Up @@ -78,16 +78,22 @@ The following is the recommended directory structure of an AcmeBlogBundle:
├── LICENSE
└── README.md
This directory structure requires to configure the bundle path to its root
directory as follows::
.. note::

This directory structure is used by default when your bundle class extends
the recommended :class:`Symfony\\Component\\HttpKernel\\Bundle\\AbstractBundle`.
If your bundle extends the :class:`Symfony\\Component\\HttpKernel\\Bundle\\Bundle`
class, you have to override the ``getPath()`` method as follows::

class AcmeBlogBundle extends Bundle
{
public function getPath(): string
use Symfony\Component\HttpKernel\Bundle\Bundle;

class AcmeBlogBundle extends Bundle
{
return \dirname(__DIR__);
public function getPath(): string
{
return \dirname(__DIR__);
}
}
}

**The following files are mandatory**, because they ensure a structure convention
that automated tools can rely on:
Expand Down
4 changes: 2 additions & 2 deletions service_container/compiler_passes.rst
Expand Up @@ -75,9 +75,9 @@ method in the extension)::

use App\DependencyInjection\Compiler\CustomPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;

class MyBundle extends Bundle
class MyBundle extends AbstractBundle
{
public function build(ContainerBuilder $container): void
{
Expand Down

0 comments on commit b7719c1

Please sign in to comment.