Passed
Branch master (6c71b4)
by Çağrı
04:22
created
src/Project/Domain/User/UserService.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,8 +77,9 @@
 block discarded – undo
77 77
     {
78 78
         $user = $this->entityManager->getRepository(User::class)->find($id);
79 79
 
80
-        if (!$user)
81
-            throw new EntityNotFoundException('user not found');
80
+        if (!$user) {
81
+                    throw new EntityNotFoundException('user not found');
82
+        }
82 83
 
83 84
         return new Item($user,$this->userTransformer,'user');
84 85
 
Please login to merge, or discard this patch.
src/Project/Domain/Article/ArticleService.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,8 +90,9 @@
 block discarded – undo
90 90
     {
91 91
         $article = $this->entityManager->getRepository(Article::class)->find($id);
92 92
 
93
-        if ($article)
94
-            return new Item($article, $this->articleTransformer, 'article');
93
+        if ($article) {
94
+                    return new Item($article, $this->articleTransformer, 'article');
95
+        }
95 96
 
96 97
         throw new EntityNotFoundException("Article not found");
97 98
     }
Please login to merge, or discard this patch.
src/Project/Http/Controller/ArticleController.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         try {
90 90
             $article = $this->articleService->getArticleById($id);
91 91
             return new JsonResponse($this->fractalService->transform($article));
92
-        }catch (\Exception $e){
92
+        } catch (\Exception $e){
93 93
             return new JsonResponse($this->fractalService->transform($e->getMessage(),false), Response::HTTP_INTERNAL_SERVER_ERROR);
94 94
         }
95 95
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         try {
145 145
             $this->articleService->addArticle($request);
146 146
             return new JsonResponse($this->fractalService->transform('Article has been added'),Response::HTTP_OK);
147
-        }catch (\Exception $exception) {
147
+        } catch (\Exception $exception) {
148 148
             return new JsonResponse($this->fractalService->transform($exception->getMessage(), false),Response::HTTP_INTERNAL_SERVER_ERROR);
149 149
         }
150 150
 
Please login to merge, or discard this patch.
src/Project/Http/Controller/UserController.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
             $user = $this->userService->getUserById($id);
96 96
             return new JsonResponse($this->fractalService->transform($user));
97 97
 
98
-        }catch (EntityNotFoundException $exception) {
98
+        } catch (EntityNotFoundException $exception) {
99 99
             return new JsonResponse($this->fractalService->transform($exception->getMessage(),false),Response::HTTP_NO_CONTENT);
100 100
         }
101 101
     }
Please login to merge, or discard this patch.
src/Project/App/Support/FractalService.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
             $resource = $this->createData($resource);
41 41
 
42 42
             $response = array_merge(['success' => $success], $resource->toArray());
43
-        }else{
43
+        } else{
44 44
             $response = [
45 45
                 'success' => $success,
46 46
                 'message' => $resource
Please login to merge, or discard this patch.