@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | private function validatePostExists(Ulid $postId): void |
40 | 40 | { |
41 | - if(!$this->postHeadersFindingRepository->postExists($postId)) { |
|
41 | + if (!$this->postHeadersFindingRepository->postExists($postId)) { |
|
42 | 42 | throw new BadRequestHttpException("Requested Post doesn't exist"); |
43 | 43 | } |
44 | 44 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | private function validateCommentExists(?Ulid $commentId): void |
50 | 50 | { |
51 | - if(!$this->commentsFindingRepository->commentExists($commentId)) { |
|
51 | + if (!$this->commentsFindingRepository->commentExists($commentId)) { |
|
52 | 52 | throw new BadRequestHttpException("Requested Parent Comment doesn't exist"); |
53 | 53 | } |
54 | 54 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | public function findPostHeaders(FindCommentsPostHeadersQuery $query): array |
26 | 26 | { |
27 | 27 | return Collection::from($this->headersFindingRepository->findPostHeaders()) |
28 | - ->map(function ($header) { |
|
28 | + ->map(function($header) { |
|
29 | 29 | return new FindCommentsPostHeadersQueryResponse( |
30 | 30 | $header->getId(), |
31 | 31 | $header->getTitle(), |
@@ -23,7 +23,7 @@ |
||
23 | 23 | public function onUserRenamed(UserRenamedCommentsIEvent $event): void |
24 | 24 | { |
25 | 25 | $this->transactionFactory |
26 | - ->createTransaction(function () use ($event) { |
|
26 | + ->createTransaction(function() use ($event) { |
|
27 | 27 | $this->securityEventsHandlingRepository->updateUserName( |
28 | 28 | new UpdatedCommentsPostHeadersUserNameDto( |
29 | 29 | $event->getOldLogin(), |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function onPostCreated(PostCreatedCommentsIEvent $event): void |
34 | 34 | { |
35 | - $this->transactionFactory->createTransaction(function () use ($event) { |
|
35 | + $this->transactionFactory->createTransaction(function() use ($event) { |
|
36 | 36 | $this->postEventsCommentsRepository->createPostHeader( |
37 | 37 | new CreateNewCommentsPostHeaderDto( |
38 | 38 | $event->getId(), |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function onPostUpdated(PostUpdatedCommentsIEvent $event): void |
55 | 55 | { |
56 | - $this->transactionFactory->createTransaction(function () use ($event) { |
|
56 | + $this->transactionFactory->createTransaction(function() use ($event) { |
|
57 | 57 | $this->postEventsCommentsRepository->updatePostHeader( |
58 | 58 | new UpdateExistingCommentsPostHeaderDto( |
59 | 59 | $event->getId(), |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function onPostDeleted(PostDeletedCommentsIEvent $event): void |
74 | 74 | { |
75 | - $this->transactionFactory->createTransaction(function () use ($event) { |
|
75 | + $this->transactionFactory->createTransaction(function() use ($event) { |
|
76 | 76 | $this->commentsDeletionRepository->deleteCommentsForPost($event->getId()); |
77 | 77 | $this->postEventsCommentsRepository->deletePostHeader( |
78 | 78 | new DeleteExistingCommentsPostHeaderDto($event->getId()) |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | return Collection::from( |
32 | 32 | $this->commentsFindingRepository->findCommentsByPostId($query->getPostId()) |
33 | - )->map(function ($comment) { |
|
33 | + )->map(function($comment) { |
|
34 | 34 | return new FindCommentsByPostIdQueryResponse( |
35 | 35 | $comment->getId(), |
36 | 36 | $comment->getAuthor(), |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $result = $this->commentsFindingRepository->findLatestComments($query->getPageNo()); |
52 | 52 | $data = Collection::from( |
53 | 53 | $result->getData() |
54 | - )->map(function ($comment) { |
|
54 | + )->map(function($comment) { |
|
55 | 55 | return new FindLatestCommentsQueryResponse( |
56 | 56 | $comment->getId(), |
57 | 57 | $comment->getAuthor(), |
@@ -42,10 +42,10 @@ |
||
42 | 42 | $this->validator->preCreate($command); |
43 | 43 | $newComment = $this->fromCreateCommand($command); |
44 | 44 | $id = $this->transactionFactory |
45 | - ->createTransaction(function () use ($newComment) { |
|
45 | + ->createTransaction(function() use ($newComment) { |
|
46 | 46 | return $this->commentsCreationRepository->createComment($newComment); |
47 | 47 | }) |
48 | - ->afterCommit(function ($id) use ($newComment, $command) { |
|
48 | + ->afterCommit(function($id) use ($newComment, $command) { |
|
49 | 49 | $this->eventPublisher->publish(new CommentCreatedOEvent($command->getPostId(), |
50 | 50 | new CommentDto($id, |
51 | 51 | $newComment->getAuthor(), |
@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | $from = $input->getArgument("from"); |
43 | 43 | if ($from != null) { |
44 | - $this->from = \DateTime::createFromFormat("Y-m-d H:i:s", $from . "00:00:00"); |
|
44 | + $this->from = \DateTime::createFromFormat("Y-m-d H:i:s", $from."00:00:00"); |
|
45 | 45 | } |
46 | 46 | $this->commentsApi->baseline($this); |
47 | 47 | if ($from != null) { |
@@ -77,7 +77,7 @@ |
||
77 | 77 | $errors = $this->validator->validate($object); |
78 | 78 | if (count($errors) > 0) { |
79 | 79 | throw new BadRequestException(sprintf('Invalid Request Body: %s', |
80 | - (string)$errors)); |
|
80 | + (string) $errors)); |
|
81 | 81 | } |
82 | 82 | return $object; |
83 | 83 | } |
@@ -104,7 +104,7 @@ |
||
104 | 104 | if ($value == null) { |
105 | 105 | return null; |
106 | 106 | } |
107 | - return is_string($value) ? $value : (string)$value; |
|
107 | + return is_string($value) ? $value : (string) $value; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |