Passed
Push — main ( dc275a...8e4fcf )
by Slawomir
04:22
created
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 2 patches
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.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     /**
28 28
      * @param CommentCreatedPostsIEvent $event
29 29
      */
30
-   public function onCommentCreated(CommentCreatedPostsIEvent $event): void
30
+    public function onCommentCreated(CommentCreatedPostsIEvent $event): void
31 31
     {
32 32
         $this->postValidator->preHandleCommentCreated($event);
33 33
         $this->transactionFactory
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             ->execute();
43 43
     }
44 44
 
45
-   public function onCommentsBaselined(CommentsBaselinedPostsIEvent $event): void
45
+    public function onCommentsBaselined(CommentsBaselinedPostsIEvent $event): void
46 46
     {
47 47
         $this->postValidator->preHandleCommentsBaselined($event);
48 48
         $this->transactionFactory
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 2 patches
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.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @param FindAllPostsQuery $query
29 29
      * @return Page<FindPostHeaderQueryResponse>
30 30
      */
31
-   public function findAllPosts(FindAllPostsQuery $query): Page
31
+    public function findAllPosts(FindAllPostsQuery $query): Page
32 32
     {
33 33
         $page = $this->findingRepository->findPosts($query->getPageNo());
34 34
         return new Page(Collection::from(
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      * @param FindPostByIdQuery $query
49 49
      * @return FindPostQueryResponse|null
50 50
      */
51
-   public function findPostById(FindPostByIdQuery $query): ?FindPostQueryResponse
51
+    public function findPostById(FindPostByIdQuery $query): ?FindPostQueryResponse
52 52
     {
53 53
         return $this->toSinglePostResponse(
54 54
             $this->findingRepository->findPost($query->getId())
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.
src/Modules/Security/Persistence/Doctrine/Entity/User.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
      */
76 76
     public function getUserIdentifier(): string
77 77
     {
78
-        return (string)$this->email;
78
+        return (string) $this->email;
79 79
     }
80 80
 
81 81
     /**
Please login to merge, or discard this patch.
Modules/Security/Domain/Provider/SymfonyDatabaseLoggedInUserProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,6 +34,6 @@
 block discarded – undo
34 34
         if ($user instanceof User) {
35 35
             return new LoggedInUser($user->getId(), $user->getUserIdentifier(), $user->getRoles());
36 36
         }
37
-        throw new \RuntimeException("Unsupported User Class: " . $user::class);
37
+        throw new \RuntimeException("Unsupported User Class: ".$user::class);
38 38
     }
39 39
 }
40 40
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     /**
23 23
      * @return LoggedInUser
24 24
      */
25
-   public function getUser(): LoggedInUser
25
+    public function getUser(): LoggedInUser
26 26
     {
27 27
         $user = $this->security->getUser();
28 28
         if ($user == null) {
Please login to merge, or discard this patch.