Skip to content

Commit

Permalink
ServiceSubscriberTrait is deprecated and replaced by ServiceMethodsSu…
Browse files Browse the repository at this point in the history
…bscriberTrait
  • Loading branch information
GromNaN committed Apr 10, 2024
1 parent fb76821 commit f17331c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions service_container/service_subscribers_locators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ the following order:
Service Subscriber Trait
------------------------

The :class:`Symfony\\Contracts\\Service\\ServiceSubscriberTrait` provides an
The :class:`Symfony\\Contracts\\Service\\ServiceMethodsSubscriberTrait` provides an
implementation for :class:`Symfony\\Contracts\\Service\\ServiceSubscriberInterface`
that looks through all methods in your class that are marked with the
:class:`Symfony\\Contracts\\Service\\Attribute\\SubscribedService` attribute. It
Expand All @@ -873,12 +873,12 @@ services based on type-hinted helper methods::
use Psr\Log\LoggerInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Contracts\Service\Attribute\SubscribedService;
use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Symfony\Contracts\Service\ServiceSubscriberTrait;

class MyService implements ServiceSubscriberInterface
{
use ServiceSubscriberTrait;
use ServiceMethodsSubscriberTrait;

public function doSomething(): void
{
Expand Down Expand Up @@ -935,12 +935,12 @@ and compose your services with them::
// src/Service/MyService.php
namespace App\Service;

use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Symfony\Contracts\Service\ServiceSubscriberTrait;

class MyService implements ServiceSubscriberInterface
{
use ServiceSubscriberTrait, LoggerAware, RouterAware;
use ServiceMethodsSubscriberTrait, LoggerAware, RouterAware;

public function doSomething(): void
{
Expand Down Expand Up @@ -977,12 +977,12 @@ Here's an example::
use Symfony\Component\DependencyInjection\Attribute\Target;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Contracts\Service\Attribute\SubscribedService;
use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Symfony\Contracts\Service\ServiceSubscriberTrait;

class MyService implements ServiceSubscriberInterface
{
use ServiceSubscriberTrait;
use ServiceMethodsSubscriberTrait;

public function doSomething(): void
{
Expand Down

0 comments on commit f17331c

Please sign in to comment.