Closed
Description
In the documentation for Compiler Passes in Bundles, the example shows:
// src/MyBundle/MyBundle.php
namespace App\MyBundle;
use App\DependencyInjection\Compiler\CustomPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class MyBundle extends Bundle
{
public function build(ContainerBuilder $container): void
{
parent::build($container);
$container->addCompilerPass(new CustomPass());
}
}
However, the call to the parent function is unnecessary because the Bundle class's implementation of the function is empty:
/**
* This method can be overridden to register compilation passes,
* other extensions, ...
*
* @return void
*/
public function build(ContainerBuilder $container)
{
}
Also, shouldn't anything related to bundles in documentation of 6.1 and beyond be extending AbstractBundle?