Passed
Branch 0.2 (92feb3)
by Lars
03:29
created
app/Providers/AuthServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         // should return either a User instance or null. You're free to obtain
31 31
         // the User instance via an API token or any other method necessary.
32 32
 
33
-        $this->app['auth']->viaRequest('api', function ($request) {
33
+        $this->app[ 'auth' ]->viaRequest('api', function($request) {
34 34
             if ($request->input('api_token')) {
35 35
                 return User::where('api_token', $request->input('api_token'))->first();
36 36
             }
Please login to merge, or discard this patch.
app/Http/Middleware/SecureCommentInputMiddleware.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
         $captcha = $request->input("captcha");
32 32
 
33 33
         if ($captcha == null) {
34
-            $returnArray["error-code"] = "captcha-missing";
34
+            $returnArray[ "error-code" ] = "captcha-missing";
35 35
             $returnStatus = 400;
36 36
         } else if ($captcha != getenv("CAPTCHA_SECRET")) {
37
-            $returnArray["error-code"] = "captcha-wrong";
37
+            $returnArray[ "error-code" ] = "captcha-wrong";
38 38
             $returnStatus = 400;
39 39
         } else if ($method == "POST" && $requestPath == "/api/comment/add") {
40 40
             $blogHash = $request->input("blogHash");
@@ -46,21 +46,21 @@  discard block
 block discarded – undo
46 46
             $articleUrl = $request->input("articleUrl");
47 47
 
48 48
             if ($blogHash == null && $articleHash == null && $articleTitle == null && $articleAuthor == null && $articleUrl == null && $authorName == null && $content == null) {
49
-                $returnArray["error-code"] = "invalid-request";
49
+                $returnArray[ "error-code" ] = "invalid-request";
50 50
                 $returnStatus = 400;
51 51
             } else if ($blogResult == null) {
52
-                $returnArray["error-code"] = "blog-not-found";
52
+                $returnArray[ "error-code" ] = "blog-not-found";
53 53
                 $returnStatus = 404;
54 54
             }
55 55
         } else if ($method == "PUT" && strpos($requestPath, "/api/comment/edit/") !== false) {
56
-            $hash = $request->route()[2]["hash"];
56
+            $hash = $request->route()[ 2 ][ "hash" ];
57 57
             $commentResult = $comment->where("hash", $hash)->first();
58 58
             if ($commentResult == null) {
59
-                $returnArray["error-code"] = "comment-not-found";
59
+                $returnArray[ "error-code" ] = "comment-not-found";
60 60
                 $returnStatus = 404;
61 61
             }
62 62
         } else {
63
-            $returnArray["error-code"] = "request-not-found";
63
+            $returnArray[ "error-code" ] = "request-not-found";
64 64
             $returnStatus = 400;
65 65
         }
66 66
 
Please login to merge, or discard this patch.
app/Http/Controllers/BlogController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
         if ($blogResult != null) {
26 26
             $blogArticle = new BlogArticle();
27
-            $blogResult["articles"] = $blogArticle->where("blogHash", $blogHash)->orderBy("created_at")->get();
27
+            $blogResult[ "articles" ] = $blogArticle->where("blogHash", $blogHash)->orderBy("created_at")->get();
28 28
 
29 29
             return FormatHelper::formatData($blogResult);
30 30
         } else {
Please login to merge, or discard this patch.
app/Http/Controllers/CommentController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         $articleResult = $article->where("hash", $articleHash)->first();
22 22
 
23 23
         if ($articleResult != null) {
24
-            $articleResult["comments"] = $comment->where("articleHash", $articleHash)->orderBy("created_at")->get();
24
+            $articleResult[ "comments" ] = $comment->where("articleHash", $articleHash)->orderBy("created_at")->get();
25 25
 
26 26
             return FormatHelper::formatData($articleResult);
27 27
         } else {
@@ -112,19 +112,19 @@  discard block
 block discarded – undo
112 112
         $dataArray = array();
113 113
 
114 114
         if ($authorName != null) {
115
-            $dataArray["authorName"] = $authorName;
115
+            $dataArray[ "authorName" ] = $authorName;
116 116
         }
117 117
 
118 118
         if ($authorMail != null) {
119
-            $dataArray["authorMail"] = $authorMail;
119
+            $dataArray[ "authorMail" ] = $authorMail;
120 120
         }
121 121
 
122 122
         if ($title != null) {
123
-            $dataArray["title"] = $title;
123
+            $dataArray[ "title" ] = $title;
124 124
         }
125 125
 
126 126
         if ($content != null) {
127
-            $dataArray["content"] = $content;
127
+            $dataArray[ "content" ] = $content;
128 128
         }
129 129
 
130 130
         $comment->where("hash", $commentHash)->update($dataArray);
Please login to merge, or discard this patch.
app/Blog.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,5 +31,5 @@
 block discarded – undo
31 31
         'name', 'description', 'url'
32 32
     ];
33 33
 
34
-    protected $hidden = [];
34
+    protected $hidden = [ ];
35 35
 }
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
app/Comments.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,5 +40,5 @@
 block discarded – undo
40 40
         'content'
41 41
     ];
42 42
 
43
-    protected $hidden = [];
43
+    protected $hidden = [ ];
44 44
 }
45 45
\ No newline at end of file
Please login to merge, or discard this patch.
app/BlogArticle.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,5 +37,5 @@
 block discarded – undo
37 37
         'url'
38 38
     ];
39 39
 
40
-    protected $hidden = [];
40
+    protected $hidden = [ ];
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.