@@ -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 | } |
@@ -25,6 +25,6 @@ |
||
25 | 25 | if ($user instanceof LoggedInUser) { |
26 | 26 | return $user; |
27 | 27 | } |
28 | - throw new \RuntimeException("Unsupported User Class: " . $user::class); |
|
28 | + throw new \RuntimeException("Unsupported User Class: ".$user::class); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | \ No newline at end of file |
@@ -23,7 +23,7 @@ |
||
23 | 23 | public function findPostHeaders(): array |
24 | 24 | { |
25 | 25 | return Collection::from($this->headersFindingRepository->findPostHeaders()) |
26 | - ->map(function ($header) { |
|
26 | + ->map(function($header) { |
|
27 | 27 | return new FindCommentsPostHeadersQueryResponse( |
28 | 28 | $header->getId(), |
29 | 29 | $header->getTitle(), |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function onCommentsCountUpdated(CommentsCountUpdatedTagsIEvent $event): void |
28 | 28 | { |
29 | 29 | $this->transactionFactory |
30 | - ->createTransaction(function () use ($event) { |
|
30 | + ->createTransaction(function() use ($event) { |
|
31 | 31 | $this->commentsEventHandlingRepository->updatePostCommentsCount( |
32 | 32 | new UpdatePostsCommentsCountDto($event->getPostId(), $event->getCommentsCount()) |
33 | 33 | ); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function findPostHeaders(): array |
27 | 27 | { |
28 | 28 | return Collection::from($this->headersFindingRepository->findPostHeaders()) |
29 | - ->map(function ($header) { |
|
29 | + ->map(function($header) { |
|
30 | 30 | return new FindTagsPostHeadersQueryResponse( |
31 | 31 | $header->getId(), |
32 | 32 | $header->getTitle(), |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | { |
50 | 50 | $page = $this->headersFindingRepository->findPostHeadersByTag($query->getTag(), $query->getPageNo()); |
51 | 51 | $data = Collection::from($page->getData()) |
52 | - ->map(function ($header) { |
|
52 | + ->map(function($header) { |
|
53 | 53 | return new FindPostsByTagQueryResponse( |
54 | 54 | $header->getId(), |
55 | 55 | $header->getTitle(), |
@@ -14,7 +14,7 @@ |
||
14 | 14 | if ($body === null) { |
15 | 15 | return ""; |
16 | 16 | } |
17 | - $short = strlen($body) - 1 < $maxLength ? $body : trim(substr($body, 0, $maxLength)). "..."; |
|
18 | - return strip_tags($short) ;; |
|
17 | + $short = strlen($body) - 1 < $maxLength ? $body : trim(substr($body, 0, $maxLength))."..."; |
|
18 | + return strip_tags($short); ; |
|
19 | 19 | } |
20 | 20 | } |
21 | 21 | \ No newline at end of file |