Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] Document automatic compiler pass registration for bundles#21651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
yceruto wants to merge1 commit intosymfony:8.1
base:8.1
Choose a base branch
Loading
fromyceruto:auto_reg_bundle_cp
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Document automatic compiler pass registration for bundles
  • Loading branch information
@yceruto
yceruto committedDec 19, 2025
commit073506023fb816d32225938888976a84943bdf90
12 changes: 3 additions & 9 deletionsservice_container/compiler_passes.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -86,9 +86,9 @@ method in the extension)::
}
}

If your compiler pass is relatively small, you can make the main bundle classimplements
:class:`Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface`so that
itcan add itself::
If your compiler pass is relatively small, you can make the main bundle classimplement
:class:`Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface`and
itwill be automatically registered as a compiler pass::

// src/MyBundle/MyBundle.php
namespace App\MyBundle;
Expand All@@ -100,12 +100,6 @@ it can add itself::

class MyBundle extends AbstractBundle implements CompilerPassInterface
{

public function build(ContainerBuilder $container): void
{
$container->addCompilerPass($this);
}

public function process(ContainerBuilder $container): void
{
// in this method you can manipulate the service container:
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp