[Chapter 7] Until the Read Side
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Cheeper\Chapter7\Application\Author\Event;
|
||||
|
||||
use Cheeper\Chapter7\Application\Author\Projection\CreateFollowersCounterProjection;
|
||||
use Cheeper\Chapter7\Application\Author\Projection\CreateFollowersCounterProjectionHandlerInterface;
|
||||
use Cheeper\Chapter7\Application\Author\Projection\CreateTimelineProjection;
|
||||
use Cheeper\Chapter7\Application\Author\Projection\CreateTimelineProjectionHandlerInterface;
|
||||
use Cheeper\Chapter7\DomainModel\Author\NewAuthorSigned;
|
||||
|
||||
final class WhenNewAuthorSignedThenCreateTimelineProjectionEventHandler
|
||||
{
|
||||
public function __construct(
|
||||
private CreateTimelineProjectionHandlerInterface $projector
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(NewAuthorSigned $event): void
|
||||
{
|
||||
$this->projector->__invoke(
|
||||
CreateTimelineProjection::ofAuthor(
|
||||
$event->authorId(),
|
||||
$event->authorUsername()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ final class AuthorFollowedEventHandlerTest extends TestCase
|
||||
AuthorId::nextIdentity(),
|
||||
);
|
||||
|
||||
$eventHandler->handle(
|
||||
$eventHandler(
|
||||
AuthorFollowed::fromFollow(
|
||||
$follow
|
||||
)
|
||||
|
||||
@@ -31,7 +31,7 @@ final class NewAuthorSignedEventHandlerTest extends TestCase
|
||||
EmailAddress::from('alice@alice.com')
|
||||
);
|
||||
|
||||
$eventHandler->handle(
|
||||
$eventHandler(
|
||||
NewAuthorSigned::fromAuthor($author)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ final class CheepPostedEventHandlerTest extends TestCase
|
||||
$projectionBus
|
||||
);
|
||||
|
||||
$eventHandler->handle(
|
||||
$eventHandler(
|
||||
CheepPosted::create(
|
||||
CheepId::nextIdentity(),
|
||||
AuthorId::nextIdentity(),
|
||||
@@ -89,7 +89,7 @@ final class CheepPostedEventHandlerTest extends TestCase
|
||||
$projectionBus
|
||||
);
|
||||
|
||||
$eventHandler->handle(
|
||||
$eventHandler(
|
||||
CheepPosted::create(
|
||||
CheepId::nextIdentity(),
|
||||
$rockStarAuthorId,
|
||||
|
||||
Reference in New Issue
Block a user