File tree Expand file tree Collapse file tree
src/Subscription/Subscriber
Benchmark/BasicImplementation/Projection
Integration/Subscription/Subscriber
Unit/Subscription/Subscriber Expand file tree Collapse file tree Load diff This file was deleted.
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1010use Patchlevel \EventSourcing \Attribute \Subscribe ;
1111use Patchlevel \EventSourcing \Attribute \Teardown ;
1212use Patchlevel \EventSourcing \Subscription \Subscriber \BatchableSubscriber ;
13- use Patchlevel \EventSourcing \Subscription \Subscriber \SubscriberUtil ;
1413use Patchlevel \EventSourcing \Tests \Benchmark \BasicImplementation \Events \NameChanged ;
1514use Patchlevel \EventSourcing \Tests \Benchmark \BasicImplementation \Events \ProfileCreated ;
1615
17- #[Projector(' profile ' )]
16+ #[Projector(self :: SUBSCRIBER_ID )]
1817final class BatchProfileProjector implements BatchableSubscriber
1918{
20- use SubscriberUtil ;
19+ private const SUBSCRIBER_ID = ' profile ' ;
2120
2221 /** @var array<string, string> */
2322 private array $ nameChanged = [];
@@ -59,7 +58,7 @@ public function onNameChanged(NameChanged $nameChanged): void
5958
6059 public function table (): string
6160 {
62- return 'projection_ ' . $ this -> subscriberId () ;
61+ return 'projection_ ' . self :: SUBSCRIBER_ID ;
6362 }
6463
6564 public function beginBatch (): void
Original file line number Diff line number Diff line change 1010use Patchlevel \EventSourcing \Attribute \Setup ;
1111use Patchlevel \EventSourcing \Attribute \Subscribe ;
1212use Patchlevel \EventSourcing \Attribute \Teardown ;
13- use Patchlevel \EventSourcing \Subscription \Subscriber \SubscriberUtil ;
1413use Patchlevel \EventSourcing \Tests \Benchmark \BasicImplementation \Events \NameChanged ;
1514use Patchlevel \EventSourcing \Tests \Benchmark \BasicImplementation \Events \ProfileCreated ;
1615use Patchlevel \EventSourcing \Tests \Benchmark \BasicImplementation \Query \QueryProfileName ;
1716
18- #[Projector(' profile ' )]
17+ #[Projector(self :: SUBSCRIBER_ID )]
1918final class ProfileProjector
2019{
21- use SubscriberUtil ;
20+ private const SUBSCRIBER_ID = ' profile ' ;
2221
2322 public function __construct (
2423 private Connection $ connection ,
@@ -70,6 +69,6 @@ public function getProfileName(QueryProfileName $queryProfileName): string
7069
7170 public function table (): string
7271 {
73- return 'projection_ ' . $ this -> subscriberId () ;
72+ return 'projection_ ' . self :: SUBSCRIBER_ID ;
7473 }
7574}
Original file line number Diff line number Diff line change 1414use Patchlevel \EventSourcing \Message \Reducer ;
1515use Patchlevel \EventSourcing \Subscription \Lookup \Lookup ;
1616use Patchlevel \EventSourcing \Subscription \RunMode ;
17- use Patchlevel \EventSourcing \Subscription \Subscriber \SubscriberUtil ;
1817use Patchlevel \EventSourcing \Tests \Integration \Subscription \Events \AdminPromoted ;
1918use Patchlevel \EventSourcing \Tests \Integration \Subscription \Events \NameChanged ;
2019use Patchlevel \EventSourcing \Tests \Integration \Subscription \Events \ProfileCreated ;
2120
22- #[Subscriber(' lookup ' , RunMode::FromBeginning)]
21+ #[Subscriber(self :: SUBSCRIBER_ID , RunMode::FromBeginning)]
2322final class LookupSubscriber
2423{
25- use SubscriberUtil ;
24+ private const SUBSCRIBER_ID = ' lookup ' ;
2625
2726 public function __construct (
2827 private Connection $ connection ,
@@ -78,6 +77,6 @@ public function drop(): void
7877
7978 private function tableName (): string
8079 {
81- return 'projection_ ' . $ this -> subscriberId () ;
80+ return 'projection_ ' . self :: SUBSCRIBER_ID ;
8281 }
8382}
Original file line number Diff line number Diff line change 1010use Patchlevel \EventSourcing \Attribute \Setup ;
1111use Patchlevel \EventSourcing \Attribute \Subscribe ;
1212use Patchlevel \EventSourcing \Attribute \Teardown ;
13- use Patchlevel \EventSourcing \Subscription \Subscriber \SubscriberUtil ;
1413use Patchlevel \EventSourcing \Tests \Integration \Subscription \Events \ProfileCreated ;
1514
16- #[Projector(' profile_2 ' )]
15+ #[Projector(self :: SUBSCRIBER_ID )]
1716final class ProfileNewProjection
1817{
19- use SubscriberUtil ;
18+ private const SUBSCRIBER_ID = ' profile_2 ' ;
2019
2120 public function __construct (
2221 private Connection $ connection ,
@@ -54,6 +53,6 @@ public function handleProfileCreated(ProfileCreated $profileCreated): void
5453
5554 private function tableName (): string
5655 {
57- return 'projection_ ' . $ this -> subscriberId () ;
56+ return 'projection_ ' . self :: SUBSCRIBER_ID ;
5857 }
5958}
Original file line number Diff line number Diff line change 1111use Patchlevel \EventSourcing \Attribute \Subscribe ;
1212use Patchlevel \EventSourcing \Attribute \Teardown ;
1313use Patchlevel \EventSourcing \Subscription \Subscriber \BatchableSubscriber ;
14- use Patchlevel \EventSourcing \Subscription \Subscriber \SubscriberUtil ;
1514use Patchlevel \EventSourcing \Tests \Integration \Subscription \Events \ProfileCreated ;
1615
17- #[Projector(' profile_1 ' )]
16+ #[Projector(self :: SUBSCRIBER_ID )]
1817final class ProfileProjection implements BatchableSubscriber
1918{
20- use SubscriberUtil ;
19+ private const SUBSCRIBER_ID = ' profile_1 ' ;
2120
2221 public function __construct (
2322 private Connection $ connection ,
@@ -55,7 +54,7 @@ public function handleProfileCreated(ProfileCreated $profileCreated): void
5554
5655 private function tableName (): string
5756 {
58- return 'projection_ ' . $ this -> subscriberId () ;
57+ return 'projection_ ' . self :: SUBSCRIBER_ID ;
5958 }
6059
6160 public function beginBatch (): void
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments