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 9, 2024
1 parent fb76821 commit de68972
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions service_container/service_subscribers_locators.rst
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,13 @@ the following order:
Service Subscriber Trait
------------------------

The :class:`Symfony\\Contracts\\Service\\ServiceSubscriberTrait` provides an
.. deprecated:: Contracts 3.5

Check failure on line 862 in service_container/service_subscribers_locators.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please provide a numeric version behind ".. deprecated::" instead of "Contracts 3.5"

Check failure on line 862 in service_container/service_subscribers_locators.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please provide a numeric version behind ".. deprecated::" instead of "Contracts 3.5"

Check failure on line 862 in service_container/service_subscribers_locators.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please only provide ".. deprecated::" if the version is greater/equal "7.0"

The :class:`Symfony\\Contracts\\Service\\ServiceSubscriberTrait` integration
is deprecated since Symfony contracts 3.5, it have been renamed to
:class:`ServiceMethodsSubscriberTrait` .

Check failure on line 866 in service_container/service_subscribers_locators.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please only use "Symfony" base namespace with Github directive

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 @@ -874,11 +880,11 @@ services based on type-hinted helper methods::
use Symfony\Component\Routing\RouterInterface;
use Symfony\Contracts\Service\Attribute\SubscribedService;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Symfony\Contracts\Service\ServiceSubscriberTrait;
use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait;

class MyService implements ServiceSubscriberInterface
{
use ServiceSubscriberTrait;
use ServiceMethodsSubscriberTrait;

public function doSomething(): void
{
Expand Down Expand Up @@ -936,11 +942,11 @@ and compose your services with them::
namespace App\Service;

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

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

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

class MyService implements ServiceSubscriberInterface
{
use ServiceSubscriberTrait;
use ServiceMethodsSubscriberTrait;

public function doSomething(): void
{
Expand Down

0 comments on commit de68972

Please sign in to comment.