Skip to content

Commit 7554370

Browse files
committed
src/Projection/User/UserProjector.php
1 parent 3481ec7 commit 7554370

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/Projection/User/UserProjector.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Prooph\ProophessorDo\Model\Todo\Event\TodoWasPosted;
1515
use Prooph\ProophessorDo\Model\Todo\Event\TodoWasReopened;
1616
use Prooph\ProophessorDo\Model\User\Event\UserWasRegistered;
17+
use Prooph\ProophessorDo\Model\User\Exception\UserNotFound;
1718
use Prooph\ProophessorDo\Projection\Table;
1819
use Doctrine\DBAL\Connection;
1920

@@ -61,14 +62,14 @@ public function onUserWasRegistered(UserWasRegistered $event)
6162
* Increases the open_todos counter of the assignee by one
6263
*
6364
* @param TodoWasPosted $event
64-
* @throws \RuntimeException
65+
* @throws UserNotFound
6566
*/
6667
public function onTodoWasPosted(TodoWasPosted $event)
6768
{
6869
$user = $this->userFinder->findUserOfTodo($event->todoId()->toString());
6970

7071
if (! $user) {
71-
throw new \RuntimeException(
72+
throw new UserNotFound(
7273
sprintf(
7374
"Data of the assigned user of the todo %s cannot be found",
7475
$event->todoId()->toString()
@@ -85,14 +86,14 @@ public function onTodoWasPosted(TodoWasPosted $event)
8586

8687
/**
8788
* @param TodoWasMarkedAsDone $event
88-
* @throws \RuntimeException if data of the the assigned user can not be found
89+
* @throws UserNotFound if data of the the assigned user can not be found
8990
*/
9091
public function onTodoWasMarkedAsDone(TodoWasMarkedAsDone $event)
9192
{
9293
$user = $this->userFinder->findUserOfTodo($event->todoId()->toString());
9394

9495
if (! $user) {
95-
throw new \RuntimeException(
96+
throw new UserNotFound(
9697
sprintf(
9798
"Data of the assigned user of the todo %s cannot be found",
9899
$event->todoId()->toString()
@@ -109,14 +110,14 @@ public function onTodoWasMarkedAsDone(TodoWasMarkedAsDone $event)
109110

110111
/**
111112
* @param TodoWasReopened $event
112-
* @throws \RuntimeException if data of the the assigned user can not be found
113+
* @throws UserNotFound if data of the the assigned user can not be found
113114
*/
114115
public function onTodoWasReopened(TodoWasReopened $event)
115116
{
116117
$user = $this->userFinder->findUserOfTodo($event->todoId()->toString());
117118

118119
if (! $user) {
119-
throw new \RuntimeException(
120+
throw new UserNotFound(
120121
sprintf(
121122
"Data of the assigned user of the todo %s cannot be found",
122123
$event->todoId()->toString()

0 commit comments

Comments
 (0)