Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions src/Subscription/Subscriber/SubscriberHelper.php

This file was deleted.

38 changes: 0 additions & 38 deletions src/Subscription/Subscriber/SubscriberUtil.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
use Patchlevel\EventSourcing\Attribute\Subscribe;
use Patchlevel\EventSourcing\Attribute\Teardown;
use Patchlevel\EventSourcing\Subscription\Subscriber\BatchableSubscriber;
use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberUtil;
use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Events\NameChanged;
use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Events\ProfileCreated;

#[Projector('profile')]
#[Projector(self::SUBSCRIBER_ID)]
final class BatchProfileProjector implements BatchableSubscriber
{
use SubscriberUtil;
private const SUBSCRIBER_ID = 'profile';

/** @var array<string, string> */
private array $nameChanged = [];
Expand Down Expand Up @@ -59,7 +58,7 @@ public function onNameChanged(NameChanged $nameChanged): void

public function table(): string
{
return 'projection_' . $this->subscriberId();
return 'projection_' . self::SUBSCRIBER_ID;
}

public function beginBatch(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
use Patchlevel\EventSourcing\Attribute\Setup;
use Patchlevel\EventSourcing\Attribute\Subscribe;
use Patchlevel\EventSourcing\Attribute\Teardown;
use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberUtil;
use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Events\NameChanged;
use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Events\ProfileCreated;
use Patchlevel\EventSourcing\Tests\Benchmark\BasicImplementation\Query\QueryProfileName;

#[Projector('profile')]
#[Projector(self::SUBSCRIBER_ID)]
final class ProfileProjector
{
use SubscriberUtil;
private const SUBSCRIBER_ID = 'profile';

public function __construct(
private Connection $connection,
Expand Down Expand Up @@ -70,6 +69,6 @@ public function getProfileName(QueryProfileName $queryProfileName): string

public function table(): string
{
return 'projection_' . $this->subscriberId();
return 'projection_' . self::SUBSCRIBER_ID;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
use Patchlevel\EventSourcing\Message\Reducer;
use Patchlevel\EventSourcing\Subscription\Lookup\Lookup;
use Patchlevel\EventSourcing\Subscription\RunMode;
use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberUtil;
use Patchlevel\EventSourcing\Tests\Integration\Subscription\Events\AdminPromoted;
use Patchlevel\EventSourcing\Tests\Integration\Subscription\Events\NameChanged;
use Patchlevel\EventSourcing\Tests\Integration\Subscription\Events\ProfileCreated;

#[Subscriber('lookup', RunMode::FromBeginning)]
#[Subscriber(self::SUBSCRIBER_ID, RunMode::FromBeginning)]
final class LookupSubscriber
{
use SubscriberUtil;
private const SUBSCRIBER_ID = 'lookup';

public function __construct(
private Connection $connection,
Expand Down Expand Up @@ -78,6 +77,6 @@ public function drop(): void

private function tableName(): string
{
return 'projection_' . $this->subscriberId();
return 'projection_' . self::SUBSCRIBER_ID;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
use Patchlevel\EventSourcing\Attribute\Setup;
use Patchlevel\EventSourcing\Attribute\Subscribe;
use Patchlevel\EventSourcing\Attribute\Teardown;
use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberUtil;
use Patchlevel\EventSourcing\Tests\Integration\Subscription\Events\ProfileCreated;

#[Projector('profile_2')]
#[Projector(self::SUBSCRIBER_ID)]
final class ProfileNewProjection
{
use SubscriberUtil;
private const SUBSCRIBER_ID = 'profile_2';

public function __construct(
private Connection $connection,
Expand Down Expand Up @@ -54,6 +53,6 @@ public function handleProfileCreated(ProfileCreated $profileCreated): void

private function tableName(): string
{
return 'projection_' . $this->subscriberId();
return 'projection_' . self::SUBSCRIBER_ID;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
use Patchlevel\EventSourcing\Attribute\Subscribe;
use Patchlevel\EventSourcing\Attribute\Teardown;
use Patchlevel\EventSourcing\Subscription\Subscriber\BatchableSubscriber;
use Patchlevel\EventSourcing\Subscription\Subscriber\SubscriberUtil;
use Patchlevel\EventSourcing\Tests\Integration\Subscription\Events\ProfileCreated;

#[Projector('profile_1')]
#[Projector(self::SUBSCRIBER_ID)]
final class ProfileProjection implements BatchableSubscriber
{
use SubscriberUtil;
private const SUBSCRIBER_ID = 'profile_1';

public function __construct(
private Connection $connection,
Expand Down Expand Up @@ -55,7 +54,7 @@ public function handleProfileCreated(ProfileCreated $profileCreated): void

private function tableName(): string
{
return 'projection_' . $this->subscriberId();
return 'projection_' . self::SUBSCRIBER_ID;
}

public function beginBatch(): void
Expand Down
26 changes: 0 additions & 26 deletions tests/Unit/Subscription/Subscriber/SubscriberHelperTest.php

This file was deleted.

Loading