Passed
Push — main ( 6d7bd8...b9bb24 )
by Slawomir
04:03
created
src/Modules/Posts/Domain/Logic/PostsRemover.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@
 block discarded – undo
34 34
         $this->validator->preDelete($command);
35 35
         $deletedPost = $this->fromDeleteCommand($command);
36 36
         $this->transactionFactory
37
-            ->createTransaction(function () use ($deletedPost) {
37
+            ->createTransaction(function() use ($deletedPost) {
38 38
                 $this->deletionRepository->deletePost($deletedPost);
39 39
             })
40
-            ->afterCommit(function () use ($deletedPost) {
40
+            ->afterCommit(function() use ($deletedPost) {
41 41
                 $this->publisher->publish(new PostDeletedOEvent($deletedPost));
42 42
             })
43 43
             ->execute();
Please login to merge, or discard this patch.
src/Modules/Posts/Domain/Logic/PostsCreator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,10 +41,10 @@
 block discarded – undo
41 41
         $this->validator->preCreate($command);
42 42
         $newPost = $this->fromCreateCommand($command);
43 43
         $id = $this->transactionFactory
44
-            ->createTransaction(function () use ($newPost) {
44
+            ->createTransaction(function() use ($newPost) {
45 45
                 return $this->creationRepository->createPost($newPost);
46 46
             })
47
-            ->afterCommit(function ($id) use ($newPost) {
47
+            ->afterCommit(function($id) use ($newPost) {
48 48
                 $this->publisher->publish(new PostCreatedOEvent($id, $newPost));
49 49
             })
50 50
             ->execute();
Please login to merge, or discard this patch.
src/Modules/Posts/Domain/Logic/PostUpdater.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,10 +35,10 @@
 block discarded – undo
35 35
         $post = $this->validator->preUpdate($command);
36 36
         $updatedPost = $this->fromUpdateCommand($command);
37 37
         $this->transactionFactory
38
-            ->createTransaction(function () use ($updatedPost) {
38
+            ->createTransaction(function() use ($updatedPost) {
39 39
                 $this->updatingRepository->updatePost($updatedPost);
40 40
             })
41
-            ->afterCommit(function () use ($post, $updatedPost) {
41
+            ->afterCommit(function() use ($post, $updatedPost) {
42 42
                 $this->publisher->publish(new PostUpdatedOEvent($updatedPost, $post->getVersion()));
43 43
             })
44 44
             ->execute();
Please login to merge, or discard this patch.
src/Modules/Posts/Domain/Logic/SecurityEventsHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function onUserRenamed(UserRenamedPostsIEvent $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 UpdatedPostsUserNameDto(
29 29
                         $event->getOldLogin(),
Please login to merge, or discard this patch.
src/Modules/Posts/Domain/Logic/CommentsEventsHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     {
32 32
         $this->postValidator->preHandleCommentCreated($event);
33 33
         $this->transactionFactory
34
-            ->createTransaction(function () use ($event) {
34
+            ->createTransaction(function() use ($event) {
35 35
                 $this->commentsEventHandlingRepository->updateAllComments(
36 36
                     new UpdatePostCommentsDto(
37 37
                         $event->getPostId(),
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $this->postValidator->preHandleCommentsBaselined($event);
48 48
         $this->transactionFactory
49
-            ->createTransaction(function () use ($event) {
49
+            ->createTransaction(function() use ($event) {
50 50
                 $this->commentsEventHandlingRepository->updateAllComments(
51 51
                     new UpdatePostCommentsDto(
52 52
                         $event->getPostId(),
Please login to merge, or discard this patch.
src/Modules/Posts/Domain/Logic/PostsValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
      */
106 106
     private function validatePostTags(array $tags): void
107 107
     {
108
-        if (count(Collection::from($tags)->filter(function ($tag) {
108
+        if (count(Collection::from($tags)->filter(function($tag) {
109 109
                 return trim($tag) == '';
110 110
             })->toArray()) > 0) {
111 111
             throw new BadRequestHttpException("Post Tags cannot be blank");
Please login to merge, or discard this patch.
src/Modules/Posts/Domain/Logic/PostsFinder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         return new Page(Collection::from(
35 35
             $page->getData()
36 36
         )
37
-            ->map(function ($postHeader) {
37
+            ->map(function($postHeader) {
38 38
                 return $this->toHeaderResponse($postHeader);
39 39
             })
40 40
             ->toArray(),
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     private function toSinglePostResponse(?PostDto $post): ?FindPostQueryResponse
81 81
     {
82
-        if($post == null) {
82
+        if ($post == null) {
83 83
             return null;
84 84
         }
85 85
         return new FindPostQueryResponse(
Please login to merge, or discard this patch.
src/Modules/Posts/Api/Controller/PostsCommandController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public function updatePost(UpdatePostCommand $command, string $id): Response
48 48
     {
49 49
         $command->setId(new Ulid($id));
50
-        if(!$this->isGranted(Permission::EDIT, $command)) {
50
+        if (!$this->isGranted(Permission::EDIT, $command)) {
51 51
             throw new UnauthorizedHttpException(Permission::EDIT);
52 52
         }
53 53
         $this->postsApi->updatePost($command);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     public function deletePost(string $id): Response
63 63
     {
64 64
         $command = new DeletePostCommand(new Ulid($id));
65
-        if(!$this->isGranted(Permission::DELETE, $command)) {
65
+        if (!$this->isGranted(Permission::DELETE, $command)) {
66 66
             throw new UnauthorizedHttpException(Permission::DELETE);
67 67
         }
68 68
         $this->postsApi->deletePost($command);
Please login to merge, or discard this patch.
src/Modules/Posts/Api/Command/BaselinePostsCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 
43 43
         $from = $input->getArgument("from");
44 44
         if ($from != null) {
45
-            $this->from = \DateTime::createFromFormat("Y-m-d H:i:s", $from . "00:00:00");
45
+            $this->from = \DateTime::createFromFormat("Y-m-d H:i:s", $from."00:00:00");
46 46
         }
47 47
         $this->postsApi->baseline($this);
48 48
         if ($from != null) {
Please login to merge, or discard this patch.