@@ -859,7 +859,13 @@ the following order:
859
859
Service Subscriber Trait
860
860
------------------------
861
861
862
- The :class: `Symfony\\ Contracts\\ Service\\ ServiceSubscriberTrait ` provides an
862
+ .. deprecated :: Contracts 3.5
863
+
864
+ :class: `Symfony\\ Contracts\\ Service\\ ServiceSubscriberTrait ` is deprecated
865
+ since Symfony contracts 3.5, it have been renamed to
866
+ :class: `Symfony\\ Contracts\\ Service\\ ServiceMethodsSubscriberTrait `.
867
+
868
+ The :class: `Symfony\\ Contracts\\ Service\\ ServiceMethodsSubscriberTrait ` provides an
863
869
implementation for :class: `Symfony\\ Contracts\\ Service\\ ServiceSubscriberInterface `
864
870
that looks through all methods in your class that are marked with the
865
871
:class: `Symfony\\ Contracts\\ Service\\ Attribute\\ SubscribedService ` attribute. It
@@ -874,11 +880,11 @@ services based on type-hinted helper methods::
874
880
use Symfony\Component\Routing\RouterInterface;
875
881
use Symfony\Contracts\Service\Attribute\SubscribedService;
876
882
use Symfony\Contracts\Service\ServiceSubscriberInterface;
877
- use Symfony\Contracts\Service\ServiceSubscriberTrait ;
883
+ use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait ;
878
884
879
885
class MyService implements ServiceSubscriberInterface
880
886
{
881
- use ServiceSubscriberTrait ;
887
+ use ServiceMethodsSubscriberTrait ;
882
888
883
889
public function doSomething(): void
884
890
{
@@ -936,11 +942,11 @@ and compose your services with them::
936
942
namespace App\Service;
937
943
938
944
use Symfony\Contracts\Service\ServiceSubscriberInterface;
939
- use Symfony\Contracts\Service\ServiceSubscriberTrait ;
945
+ use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait ;
940
946
941
947
class MyService implements ServiceSubscriberInterface
942
948
{
943
- use ServiceSubscriberTrait , LoggerAware, RouterAware;
949
+ use ServiceMethodsSubscriberTrait , LoggerAware, RouterAware;
944
950
945
951
public function doSomething(): void
946
952
{
@@ -978,11 +984,11 @@ Here's an example::
978
984
use Symfony\Component\Routing\RouterInterface;
979
985
use Symfony\Contracts\Service\Attribute\SubscribedService;
980
986
use Symfony\Contracts\Service\ServiceSubscriberInterface;
981
- use Symfony\Contracts\Service\ServiceSubscriberTrait ;
987
+ use Symfony\Contracts\Service\ServiceMethodsSubscriberTrait ;
982
988
983
989
class MyService implements ServiceSubscriberInterface
984
990
{
985
- use ServiceSubscriberTrait ;
991
+ use ServiceMethodsSubscriberTrait ;
986
992
987
993
public function doSomething(): void
988
994
{
0 commit comments