Skip to content

Commit

Permalink
Some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
theUniC committed Mar 16, 2024
1 parent 649269f commit 6b59474
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Cheeper\Chapter7\Application\ProjectionBus;
use Cheeper\Chapter8\DomainModel\Follow\AuthorFollowed;
use Cheeper\Chapter8\DomainModel\Follow\FollowRepository;
use Cheeper\Chapter9\Application\Author\Projection\AddAuthorToListOfAuthorsWithMoreThanThousandFollowersProjection;

final readonly class WhenAuthorFollowedThenListAuthorsWithMoreThanThousandFollowersEventHandler
{
Expand All @@ -23,9 +24,7 @@ public function __invoke(AuthorFollowed $event): void
{
if ($this->followRepository->numberOfFollowersFor(AuthorId::fromString($event->toAuthorId())) >= 1000) {
$this->projectionBus->project(
IncrementCountFollowersProjection::ofAuthor(
$event->toAuthorId()
)
new AddAuthorToListOfAuthorsWithMoreThanThousandFollowersProjection($event->toAuthorId())
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

namespace Cheeper\Chapter9\Application\Author\Projection;

final readonly class AddAuthorToListOfAuthorsWithMoreThanThousandFollowersProjection
use Cheeper\Chapter7\Application\Projection;

final readonly class AddAuthorToListOfAuthorsWithMoreThanThousandFollowersProjection implements Projection
{
public function __construct(
public string $authorId
Expand Down

0 comments on commit 6b59474

Please sign in to comment.