@@ -11,9 +11,9 @@ |
||
11 | 11 | ->where('comments.user_id', '=', $user_id) |
12 | 12 | ->first(); |
13 | 13 | |
14 | - if($comments->up > 0 || $comments->down > 0){ |
|
14 | + if ($comments->up > 0 || $comments->down > 0) { |
|
15 | 15 | return false; |
16 | - } else{ |
|
16 | + }else { |
|
17 | 17 | return true; |
18 | 18 | } |
19 | 19 | } |
@@ -83,7 +83,7 @@ |
||
83 | 83 | /** |
84 | 84 | * @param string $type |
85 | 85 | */ |
86 | - public static function getCommentsMax($type){ |
|
86 | + public static function getCommentsMax($type) { |
|
87 | 87 | $v = \DB::table('comments') |
88 | 88 | ->selectRaw('count(id) as maxviews') |
89 | 89 | ->where('content_type', '=', \DB::raw("'".$type."'")) |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | |
26 | 26 | if ($releasedate) { |
27 | 27 | return Carbon::parse($releasedate->reldate)->toDateString(); |
28 | - }else { |
|
28 | + } else { |
|
29 | 29 | return ''; |
30 | 30 | } |
31 | 31 | |
32 | - }else { |
|
32 | + } else { |
|
33 | 33 | return Carbon::parse($game->release_date)->toDateString(); |
34 | 34 | } |
35 | 35 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | if ($lang) { |
102 | 102 | return $lang->id; |
103 | - }else { |
|
103 | + } else { |
|
104 | 104 | return 0; |
105 | 105 | } |
106 | 106 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | if ($dev) { |
116 | 116 | return $dev->id; |
117 | - }else { |
|
117 | + } else { |
|
118 | 118 | return 0; |
119 | 119 | } |
120 | 120 |
@@ -23,13 +23,13 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | - public static function getPopularity($views, $max){ |
|
26 | + public static function getPopularity($views, $max) { |
|
27 | 27 | |
28 | 28 | $ret = 0; |
29 | 29 | |
30 | - if($max == 0 || $views == 0){ |
|
30 | + if ($max == 0 || $views == 0) { |
|
31 | 31 | $ret = 0; |
32 | - } else{ |
|
32 | + }else { |
|
33 | 33 | $ret = ($views / $max) * 100; |
34 | 34 | } |
35 | 35 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * @param integer $size |
41 | 41 | */ |
42 | - public static function getReadableBytes($size){ |
|
42 | + public static function getReadableBytes($size) { |
|
43 | 43 | $bytes = $size; |
44 | 44 | |
45 | 45 | if ($bytes == 0) { |
@@ -10,12 +10,13 @@ |
||
10 | 10 | if (is_array($value)) { |
11 | 11 | if (!isset($array2[$key]) || !is_array($array2[$key])) { |
12 | 12 | $difference[$key] = $value; |
13 | - }else { |
|
13 | + } else { |
|
14 | 14 | $new_diff = MiscHelper::array_diff_assoc_recursive($value, $array2[$key]); |
15 | - if (!empty($new_diff)) |
|
16 | - $difference[$key] = $new_diff; |
|
15 | + if (!empty($new_diff)) { |
|
16 | + $difference[$key] = $new_diff; |
|
17 | + } |
|
17 | 18 | } |
18 | - }else if (!array_key_exists($key, $array2) || $array2[$key] !== $value) { |
|
19 | + } else if (!array_key_exists($key, $array2) || $array2[$key] !== $value) { |
|
19 | 20 | $difference[$key] = $value; |
20 | 21 | } |
21 | 22 | } |
@@ -209,7 +209,7 @@ |
||
209 | 209 | if ($request->get('forbidden') && ($request->get('forbidden') <> '')) { |
210 | 210 | $gamefile->forbidden = 1; |
211 | 211 | $gamefile->reason = $request->get('forbidden'); |
212 | - }else { |
|
212 | + } else { |
|
213 | 213 | $gamefile->forbidden = 0; |
214 | 214 | $gamefile->reason = ''; |
215 | 215 | } |
@@ -374,17 +374,17 @@ |
||
374 | 374 | if ($request->get('content_type') == 'url') { |
375 | 375 | if (filter_var($request->get('url'), FILTER_VALIDATE_URL)) { |
376 | 376 | $content_path = $request->get('url'); |
377 | - }else { |
|
377 | + } else { |
|
378 | 378 | return back()->withInput(); |
379 | 379 | } |
380 | - }else { |
|
380 | + } else { |
|
381 | 381 | $storagetemp = 'temp/'.$request->get('uuid').'/file'; |
382 | 382 | $storagedest = 'resources/'.$request->get('uuid').'.'.$request->get('ext'); |
383 | 383 | |
384 | 384 | $exists = \Storage::disk('local')->exists($storagetemp); |
385 | 385 | if ($exists === true) { |
386 | 386 | \Storage::move($storagetemp, $storagedest); |
387 | - }else { |
|
387 | + } else { |
|
388 | 388 | return back()->withInput(); |
389 | 389 | } |
390 | 390 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $list = \DB::table('user_lists') |
50 | 50 | ->where('id', '=', $listid) |
51 | 51 | ->delete(); |
52 | - }else { |
|
52 | + } else { |
|
53 | 53 | $list = \DB::table('user_lists') |
54 | 54 | ->where('id', '=', $listid) |
55 | 55 | ->where('user_id', '=', \Auth::id()) |
@@ -41,7 +41,7 @@ |
||
41 | 41 | foreach ($games as $g) { |
42 | 42 | if (is_null($g->subtitle) || $g->subtitle == '') { |
43 | 43 | $result[] = ['id' => $g->id, 'value' => $g->title]; |
44 | - }else { |
|
44 | + } else { |
|
45 | 45 | $result[] = ['id' => $g->id, 'value' => $g->title.' -=- '.$g->subtitle]; |
46 | 46 | } |
47 | 47 |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | $games = Game::Join('games_developer', 'games.id', '=', 'games_developer.game_id') |
31 | 31 | ->Join('developer', 'games_developer.developer_id', '=', 'developer.id') |
32 | 32 | ->orderBy($orderby, $direction)->select('games.*')->paginate(20); |
33 | - }elseif ($orderby == 'game.release_date') { |
|
33 | + } elseif ($orderby == 'game.release_date') { |
|
34 | 34 | $games = Game::Join('games_files', 'games.id', '=', 'games_files.game_id') |
35 | 35 | ->orderBy('games_files.release_year', $direction) |
36 | 36 | ->orderBy('games_files.release_month', $direction) |
37 | 37 | ->orderBy('games_files.release_day', $direction) |
38 | 38 | ->select('games.*') |
39 | 39 | ->paginate(20); |
40 | - }else { |
|
40 | + } else { |
|
41 | 41 | $games = Game::orderBy($orderby, $direction)->orderBy('title')->orderBy('subtitle')->paginate(20); |
42 | 42 | } |
43 | 43 | |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | GamesDeveloper::whereGameId($id)->delete(); |
279 | 279 | Comment::whereContentId($id)->where('content_type', '=', 'game')->delete(); |
280 | 280 | TagRelation::whereContentId($id)->where('content_type', '=', 'game')->delete(); |
281 | - }else { |
|
281 | + } else { |
|
282 | 282 | return redirect()->action('GameController@edit', $id); |
283 | 283 | } |
284 | 284 | } |
@@ -28,9 +28,9 @@ |
||
28 | 28 | |
29 | 29 | if ($type == 'news') { |
30 | 30 | $msg['redirect_to'] = url('news', $id); |
31 | - }elseif ($type == 'game') { |
|
31 | + } elseif ($type == 'game') { |
|
32 | 32 | $msg['redirect_to'] = url('games', $id); |
33 | - }elseif ($type == 'resource') { |
|
33 | + } elseif ($type == 'resource') { |
|
34 | 34 | $msg['redirect_to'] = route('resources.show', DatabaseHelper::getResourcePathArray($id)); |
35 | 35 | } |
36 | 36 |