@@ -9,15 +9,15 @@ discard block |
||
| 9 | 9 | $difference = []; |
| 10 | 10 | foreach ($array1 as $key => $value) { |
| 11 | 11 | if (is_array($value)) { |
| 12 | - if (! isset($array2[$key]) || ! is_array($array2[$key])) { |
|
| 12 | + if (!isset($array2[$key]) || !is_array($array2[$key])) { |
|
| 13 | 13 | $difference[$key] = $value; |
| 14 | - } else { |
|
| 14 | + }else { |
|
| 15 | 15 | $new_diff = self::array_diff_assoc_recursive($value, $array2[$key]); |
| 16 | - if (! empty($new_diff)) { |
|
| 16 | + if (!empty($new_diff)) { |
|
| 17 | 17 | $difference[$key] = $new_diff; |
| 18 | 18 | } |
| 19 | 19 | } |
| 20 | - } elseif (! array_key_exists($key, $array2) || $array2[$key] !== $value) { |
|
| 20 | + } elseif (!array_key_exists($key, $array2) || $array2[$key] !== $value) { |
|
| 21 | 21 | $difference[$key] = $value; |
| 22 | 22 | } |
| 23 | 23 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | if ($max == 0 || $views == 0) { |
| 31 | 31 | $ret = 0; |
| 32 | - } else { |
|
| 32 | + }else { |
|
| 33 | 33 | $ret = ($views / $max) * 100; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | * |
| 17 | 17 | * @param string $branch The git branch to check |
| 18 | 18 | * |
| 19 | - * @return mixed Either the hash or a boolean false |
|
| 19 | + * @return string Either the hash or a boolean false |
|
| 20 | 20 | */ |
| 21 | 21 | public static function get_current_git_commit($branch = 'master') |
| 22 | 22 | { |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $fu = new FineUploader(); |
| 20 | 20 | $destpath = storage_path('app/public/temp'); |
| 21 | - if (! file_exists($destpath)) { |
|
| 21 | + if (!file_exists($destpath)) { |
|
| 22 | 22 | mkdir($destpath); |
| 23 | 23 | } |
| 24 | 24 | $res = $fu->handleUpload(storage_path('app/public/temp'), 'file'); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $es->reg_end_date = $request->get('reg_end'); |
| 72 | 72 | if ($request->get('reg_allowed') == 'on') { |
| 73 | 73 | $es->reg_allowed = 1; |
| 74 | - } else { |
|
| 74 | + }else { |
|
| 75 | 75 | $es->reg_allowed = 0; |
| 76 | 76 | } |
| 77 | 77 | $es->save(); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $settings->reg_allowed = Input::get('reg_allowed'); |
| 105 | 105 | if (Input::get('reg_allowed') == 'on') { |
| 106 | 106 | $settings->reg_allowed = 1; |
| 107 | - } else { |
|
| 107 | + }else { |
|
| 108 | 108 | $settings->reg_allowed = 0; |
| 109 | 109 | } |
| 110 | 110 | $settings->save(); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $games = Game::Join('games_developer', 'games.id', '=', 'games_developer.game_id') |
| 38 | 38 | ->Join('developer', 'games_developer.developer_id', '=', 'developer.id') |
| 39 | 39 | ->orderBy($orderby, $direction)->select('games.*')->paginate($rows); |
| 40 | - } else { |
|
| 40 | + }else { |
|
| 41 | 41 | $games = Game::orderBy($orderby, $direction)->orderBy('title')->orderBy('subtitle')->paginate($rows); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | GamesDeveloper::whereGameId($id)->delete(); |
| 287 | 287 | Comment::whereContentId($id)->where('content_type', '=', 'game')->delete(); |
| 288 | 288 | TagRelation::whereContentId($id)->where('content_type', '=', 'game')->delete(); |
| 289 | - } else { |
|
| 289 | + }else { |
|
| 290 | 290 | return redirect()->action('GameController@edit', $id); |
| 291 | 291 | } |
| 292 | 292 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | if (\Auth::check()) { |
| 63 | 63 | $pm = \Auth::user()->newThreadsCount(); |
| 64 | - } else { |
|
| 64 | + }else { |
|
| 65 | 65 | $pm = ''; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | ->leftJoin('developer', 'games_developer.developer_id', '=', 'developer.id') |
| 97 | 97 | ->leftJoin('makers', 'makers.id', '=', 'games.maker_id') |
| 98 | 98 | ->leftJoin('languages', 'languages.id', '=', 'games.lang_id') |
| 99 | - ->leftJoin('comments', function ($join) { |
|
| 99 | + ->leftJoin('comments', function($join) { |
|
| 100 | 100 | $join->on('comments.content_id', '=', 'games.id'); |
| 101 | 101 | $join->on('comments.content_type', '=', \DB::raw("'game'")); |
| 102 | 102 | }) |
@@ -148,6 +148,9 @@ |
||
| 148 | 148 | $this->info('Fertig.'); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | + /** |
|
| 152 | + * @return string |
|
| 153 | + */ |
|
| 151 | 154 | public function search_for_base_path($filepath) |
| 152 | 155 | { |
| 153 | 156 | $dirarray = [ |
@@ -107,20 +107,20 @@ discard block |
||
| 107 | 107 | break; |
| 108 | 108 | } |
| 109 | 109 | } |
| 110 | - } else { |
|
| 110 | + }else { |
|
| 111 | 111 | // RPG Maker 2k/2k3 |
| 112 | 112 | for ($i = 0; $i < $zip->numFiles; $i++) { |
| 113 | 113 | $filename = $zip->getNameIndex($i); |
| 114 | 114 | |
| 115 | - if (! ends_with($filename, '/') and ! starts_with($filename, '_MACOSX')) { |
|
| 115 | + if (!ends_with($filename, '/') and !starts_with($filename, '_MACOSX')) { |
|
| 116 | 116 | $imp = $this->search_for_base_path($filename); |
| 117 | 117 | |
| 118 | - if (! $imp == '') { |
|
| 118 | + if (!$imp == '') { |
|
| 119 | 119 | $pl = new PlayerIndexjson(); |
| 120 | 120 | $pl->gamefile_id = $toindex->id; |
| 121 | - if (! ends_with(strtolower($imp), ['.exe', '.lmu', '.ldb', 'ini', '.dll', 'lmt', 'lsd'])) { |
|
| 121 | + if (!ends_with(strtolower($imp), ['.exe', '.lmu', '.ldb', 'ini', '.dll', 'lmt', 'lsd'])) { |
|
| 122 | 122 | $pl->key = preg_replace('/(\.\w+$)/', '', strtolower($imp)); |
| 123 | - } else { |
|
| 123 | + }else { |
|
| 124 | 124 | $pl->key = strtolower($imp); |
| 125 | 125 | } |
| 126 | 126 | $pl->value = $imp; |
@@ -128,14 +128,14 @@ discard block |
||
| 128 | 128 | $pl->save(); |
| 129 | 129 | |
| 130 | 130 | \Log::info('Saved basepath: '.$filename); |
| 131 | - } else { |
|
| 131 | + }else { |
|
| 132 | 132 | \Log::info('Empty basepath: '.$filename); |
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | 137 | @$zip->close(); |
| 138 | - } else { |
|
| 138 | + }else { |
|
| 139 | 139 | continue; |
| 140 | 140 | } |
| 141 | 141 | |
@@ -191,13 +191,13 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | if (starts_with(strtolower($filepath), $searcharray)) { |
| 193 | 193 | $imp = str_replace('/', '\\/', $filepath); |
| 194 | - } else { |
|
| 194 | + }else { |
|
| 195 | 195 | if (str_contains(strtolower($filepath), $searcharray)) { |
| 196 | 196 | $exp = explode('/', $filepath); |
| 197 | 197 | $res = array_shift($exp); |
| 198 | 198 | $imp = implode('/', $exp); |
| 199 | 199 | $imp = $this->search_for_base_path($imp); |
| 200 | - } else { |
|
| 200 | + }else { |
|
| 201 | 201 | $imp = ''; |
| 202 | 202 | } |
| 203 | 203 | } |
@@ -93,6 +93,9 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | + /** |
|
| 97 | + * @param string $path |
|
| 98 | + */ |
|
| 96 | 99 | public function Delete($path) |
| 97 | 100 | { |
| 98 | 101 | // check for directory is not a file |
@@ -122,6 +125,10 @@ discard block |
||
| 122 | 125 | return false; |
| 123 | 126 | } |
| 124 | 127 | |
| 128 | + /** |
|
| 129 | + * @param string $source |
|
| 130 | + * @param string $destination |
|
| 131 | + */ |
|
| 125 | 132 | public function Zip($source, $destination) |
| 126 | 133 | { |
| 127 | 134 | // check for php_zip extension and file existance |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | foreach ($files as $f) { |
| 52 | 52 | //Check for maker engine 2=rm2k, 3=rm2k3, 9=rm2k3 Steam Edition |
| 53 | - if (! array_search($f->game->maker_id, [2, 3, 6, 9, 11]) === false) { |
|
| 53 | + if (!array_search($f->game->maker_id, [2, 3, 6, 9, 11]) === false) { |
|
| 54 | 54 | echo "Gamefile: $f->filename"; |
| 55 | 55 | |
| 56 | 56 | //prepare the path variables |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->Zip($pathdest, $pathzip); |
| 72 | 72 | |
| 73 | 73 | // Check for zip file |
| 74 | - if(!file_exists($pathzip)){ |
|
| 74 | + if (!file_exists($pathzip)) { |
|
| 75 | 75 | // zip file does not exist. debug & die. |
| 76 | 76 | dd($pathzip); |
| 77 | 77 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | public function Zip($source, $destination) |
| 126 | 126 | { |
| 127 | 127 | // check for php_zip extension and file existance |
| 128 | - if (! extension_loaded('zip') || ! file_exists($source)) { |
|
| 128 | + if (!extension_loaded('zip') || !file_exists($source)) { |
|
| 129 | 129 | return false; |
| 130 | 130 | } |
| 131 | 131 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $zip = new \ZipArchive(); |
| 134 | 134 | |
| 135 | 135 | // Create a new ZIP |
| 136 | - if (! $zip->open($destination, \ZIPARCHIVE::CREATE)) { |
|
| 136 | + if (!$zip->open($destination, \ZIPARCHIVE::CREATE)) { |
|
| 137 | 137 | return false; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -11,6 +11,9 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | class PlayerHelper |
| 13 | 13 | { |
| 14 | + /** |
|
| 15 | + * @param string $data |
|
| 16 | + */ |
|
| 14 | 17 | public static function getSavegameValidation($data) |
| 15 | 18 | { |
| 16 | 19 | $br = new BinaryReader($data); |
@@ -27,6 +30,9 @@ discard block |
||
| 27 | 30 | } |
| 28 | 31 | } |
| 29 | 32 | |
| 33 | + /** |
|
| 34 | + * @return string |
|
| 35 | + */ |
|
| 30 | 36 | public function getZipRootPath($zipfilepath) |
| 31 | 37 | { |
| 32 | 38 | $dirarray = [ |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | if ($returned == 'LcfSaveData') { |
| 24 | 24 | return true; |
| 25 | - } else { |
|
| 25 | + }else { |
|
| 26 | 26 | return false; |
| 27 | 27 | } |
| 28 | 28 | } |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | if (starts_with(strtolower($zipfilepath), $searcharray)) { |
| 72 | 72 | $imp = str_replace('/', '\\/', $zipfilepath); |
| 73 | - } else { |
|
| 73 | + }else { |
|
| 74 | 74 | if (str_contains(strtolower($zipfilepath), $searcharray)) { |
| 75 | 75 | $exp = explode('/', $zipfilepath); |
| 76 | 76 | $res = array_shift($exp); |
| 77 | 77 | $imp = implode('/', $exp); |
| 78 | 78 | $imp = $this->getZipRootPath($imp); |
| 79 | - } else { |
|
| 79 | + }else { |
|
| 80 | 80 | $imp = ''; |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -12,6 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | class SearchFilterHelper |
| 14 | 14 | { |
| 15 | + /** |
|
| 16 | + * @param string $searchterm |
|
| 17 | + */ |
|
| 15 | 18 | public static function searchFilter($searchterm) |
| 16 | 19 | { |
| 17 | 20 | $result = []; |