@@ -31,10 +31,10 @@ discard block |
||
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 |
||
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 |
@@ -24,7 +24,7 @@ |
||
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 { |
@@ -21,7 +21,7 @@ discard block |
||
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 |
||
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); |
@@ -31,5 +31,5 @@ |
||
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 |
@@ -40,5 +40,5 @@ |
||
40 | 40 | 'content' |
41 | 41 | ]; |
42 | 42 | |
43 | - protected $hidden = []; |
|
43 | + protected $hidden = [ ]; |
|
44 | 44 | } |
45 | 45 | \ No newline at end of file |
@@ -37,5 +37,5 @@ |
||
37 | 37 | 'url' |
38 | 38 | ]; |
39 | 39 | |
40 | - protected $hidden = []; |
|
40 | + protected $hidden = [ ]; |
|
41 | 41 | } |
42 | 42 | \ No newline at end of file |