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

Commit2b5bcd4

Browse files
Added fixes after testing xml and php code
1 parent07af97a commit2b5bcd4

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
@@ -604,8 +604,15 @@ The tagged services can be prioritized using the ``priority`` attribute:
604604
..code-block::php
605605
606606
// config/services.php
607-
$container->register(App\Handler\One::class)
608-
->addTag('app.handler', ['priority' => 20]);
607+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
608+
609+
return function(ContainerConfigurator $configurator) {
610+
$services = $configurator->services();
611+
612+
$services->set(App\Handler\One::class)
613+
->tag('app.handler', ['priority' => 20])
614+
;
615+
};
609616
610617
..note::
611618

@@ -649,15 +656,27 @@ If you want to have another method defining the priority, you can define it in t
649656
https://symfony.com/schema/dic/services/services-1.0.xsd">
650657
<services>
651658
<serviceid="App\HandlerCollection">
652-
<argumenttype="tagged"tag="app.handler"default_priority_method="getPriority"/>
659+
<argumenttype="tagged"tag="app.handler"default-priority-method="getPriority"/>
653660
</service>
654661
</services>
655662
</container>
656663
657664
..code-block::php
658665
659666
// config/services.php
667+
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
668+
660669
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
661670
662-
$container->register(App\HandlerCollection::class)
663-
->addArgument(new TaggedIteratorArgument('app.handler', null, null, false, 'getPriority'));
671+
return function (ContainerConfigurator $configurator) {
672+
$services = $configurator->services();
673+
674+
// ...
675+
676+
$services->set(App\HandlerCollection::class)
677+
->args(
678+
[
679+
new TaggedIteratorArgument('app.handler', null, null, false, 'getPriority'),
680+
]
681+
);
682+
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp