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

Commit59ee885

Browse files
Added fixes after testing xml and php code
1 parent15c6007 commit59ee885

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

‎service_container/tags.rst‎

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,15 @@ The tagged services can be prioritized using the ``priority`` attribute:
619619
..code-block::php
620620
621621
// config/services.php
622-
$container->register(App\Handler\One::class)
623-
->addTag('app.handler', ['priority' => 20]);
622+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
623+
624+
return function(ContainerConfigurator $configurator) {
625+
$services = $configurator->services();
626+
627+
$services->set(App\Handler\One::class)
628+
->tag('app.handler', ['priority' => 20])
629+
;
630+
};
624631
625632
..note::
626633

@@ -664,15 +671,27 @@ If you want to have another method defining the priority, you can define it in t
664671
https://symfony.com/schema/dic/services/services-1.0.xsd">
665672
<services>
666673
<serviceid="App\HandlerCollection">
667-
<argumenttype="tagged"tag="app.handler"default_priority_method="getPriority"/>
674+
<argumenttype="tagged"tag="app.handler"default-priority-method="getPriority"/>
668675
</service>
669676
</services>
670677
</container>
671678
672679
..code-block::php
673680
674681
// config/services.php
682+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
683+
675684
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
676685
677-
$container->register(App\HandlerCollection::class)
678-
->addArgument(new TaggedIteratorArgument('app.handler', null, null, false, 'getPriority'));
686+
return function (ContainerConfigurator $configurator) {
687+
$services = $configurator->services();
688+
689+
// ...
690+
691+
$services->set(App\HandlerCollection::class)
692+
->args(
693+
[
694+
new TaggedIteratorArgument('app.handler', null, null, false, 'getPriority'),
695+
]
696+
);
697+
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp