@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | $releases = new Releases; |
| 18 | 18 | |
| 19 | 19 | $ordering = $releases->getBrowseOrdering(); |
| 20 | - $orderBy = $request->has('ob') && ! empty($request->input('ob')) ? $request->input('ob') : ''; |
|
| 20 | + $orderBy = $request->has('ob') && !empty($request->input('ob')) ? $request->input('ob') : ''; |
|
| 21 | 21 | $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; |
| 22 | 22 | $offset = ($page - 1) * config('nntmux.items_per_page'); |
| 23 | 23 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $catarray[] = $category; |
| 67 | 67 | |
| 68 | 68 | $ordering = $releases->getBrowseOrdering(); |
| 69 | - $orderBy = $request->has('ob') && ! empty($request->input('ob')) ? $request->input('ob') : ''; |
|
| 69 | + $orderBy = $request->has('ob') && !empty($request->input('ob')) ? $request->input('ob') : ''; |
|
| 70 | 70 | $page = $request->has('page') && is_numeric($request->input('page')) ? $request->input('page') : 1; |
| 71 | 71 | $offset = ($page - 1) * config('nntmux.items_per_page'); |
| 72 | 72 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | ]; |
| 61 | 61 | |
| 62 | 62 | // Initialize userdata property for controllers that need it |
| 63 | - $this->middleware(function ($request, $next) { |
|
| 63 | + $this->middleware(function($request, $next) { |
|
| 64 | 64 | if (Auth::check()) { |
| 65 | 65 | $this->userdata = User::find(Auth::id()); |
| 66 | 66 | $this->userdata->categoryexclusions = User::getCategoryExclusionById(Auth::id()); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | // Validate cover type |
| 21 | 21 | $validTypes = ['anime', 'audio', 'audiosample', 'book', 'console', 'games', 'movies', 'music', 'preview', 'sample', 'tvrage', 'video', 'xxx', 'tvshows']; |
| 22 | 22 | |
| 23 | - if (! in_array($type, $validTypes)) { |
|
| 23 | + if (!in_array($type, $validTypes)) { |
|
| 24 | 24 | abort(404); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $filePath = storage_path("covers/{$type}/{$filename}"); |
| 29 | 29 | |
| 30 | 30 | // For preview and sample images, try with _thumb suffix if original doesn't exist |
| 31 | - if (! file_exists($filePath) && in_array($type, ['preview', 'sample'])) { |
|
| 31 | + if (!file_exists($filePath) && in_array($type, ['preview', 'sample'])) { |
|
| 32 | 32 | // Try with _thumb suffix |
| 33 | 33 | $pathInfo = pathinfo($filename); |
| 34 | 34 | $thumbFilename = $pathInfo['filename'].'_thumb.'.($pathInfo['extension'] ?? 'jpg'); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // Check if file exists |
| 43 | - if (! file_exists($filePath)) { |
|
| 43 | + if (!file_exists($filePath)) { |
|
| 44 | 44 | // Return placeholder image |
| 45 | 45 | $placeholderPath = public_path('assets/images/no-cover.png'); |
| 46 | 46 | if (file_exists($placeholderPath)) { |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | $movie = new Movie(['Settings' => $this->settings]); |
| 17 | 17 | |
| 18 | - $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function ($mcat) { |
|
| 18 | + $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function($mcat) { |
|
| 19 | 19 | return ['id' => $mcat->id, 'title' => $mcat->title]; |
| 20 | 20 | }); |
| 21 | 21 | |
@@ -32,14 +32,14 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $orderby = $request->input('ob', ''); |
| 34 | 34 | $ordering = $movie->getMovieOrdering(); |
| 35 | - if (! in_array($orderby, $ordering, false)) { |
|
| 35 | + if (!in_array($orderby, $ordering, false)) { |
|
| 36 | 36 | $orderby = ''; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $rslt = $movie->getMovieRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, -1, $this->userdata->categoryexclusions); |
| 40 | 40 | $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); |
| 41 | 41 | |
| 42 | - $movies = $results->map(function ($result) { |
|
| 42 | + $movies = $results->map(function($result) { |
|
| 43 | 43 | $result['genre'] = makeFieldLinks($result, 'genre', 'movies'); |
| 44 | 44 | $result['actors'] = makeFieldLinks($result, 'actors', 'movies'); |
| 45 | 45 | $result['director'] = makeFieldLinks($result, 'director', 'movies'); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | // Get movie info |
| 99 | 99 | $movieInfo = $movie->getMovieInfo($imdbid); |
| 100 | 100 | |
| 101 | - if (! $movieInfo) { |
|
| 101 | + if (!$movieInfo) { |
|
| 102 | 102 | return redirect()->route('Movies')->with('error', 'Movie not found'); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | // Filter to only this movie's IMDB ID |
| 109 | 109 | $movieData = collect($rslt)->firstWhere('imdbid', $imdbid); |
| 110 | 110 | |
| 111 | - if (! $movieData) { |
|
| 111 | + if (!$movieData) { |
|
| 112 | 112 | return redirect()->route('Movies')->with('error', 'No releases found for this movie'); |
| 113 | 113 | } |
| 114 | 114 | |
@@ -133,13 +133,13 @@ discard block |
||
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | // Only process fields if they exist and are not empty |
| 136 | - if (! empty($movieArray['genre'])) { |
|
| 136 | + if (!empty($movieArray['genre'])) { |
|
| 137 | 137 | $movieArray['genre'] = makeFieldLinks($movieArray, 'genre', 'movies'); |
| 138 | 138 | } |
| 139 | - if (! empty($movieArray['actors'])) { |
|
| 139 | + if (!empty($movieArray['actors'])) { |
|
| 140 | 140 | $movieArray['actors'] = makeFieldLinks($movieArray, 'actors', 'movies'); |
| 141 | 141 | } |
| 142 | - if (! empty($movieArray['director'])) { |
|
| 142 | + if (!empty($movieArray['director'])) { |
|
| 143 | 143 | $movieArray['director'] = makeFieldLinks($movieArray, 'director', 'movies'); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | if ($request->has('id') && ctype_digit($request->input('id'))) { |
| 188 | 188 | $mov = $movie->getMovieInfo($request->input('id')); |
| 189 | 189 | |
| 190 | - if (! $mov) { |
|
| 190 | + if (!$mov) { |
|
| 191 | 191 | return response()->json(['message' => 'There is no trailer for this movie.'], 404); |
| 192 | 192 | } |
| 193 | 193 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | // Get the default user role. |
| 159 | 159 | $userDefault = Role::query()->where('isdefault', '=', 1)->first(); |
| 160 | 160 | |
| 161 | - if (! empty($error)) { |
|
| 161 | + if (!empty($error)) { |
|
| 162 | 162 | return $this->showRegistrationForm($request, $error); |
| 163 | 163 | } |
| 164 | 164 | |
@@ -171,13 +171,13 @@ discard block |
||
| 171 | 171 | $invitedBy = 0; |
| 172 | 172 | $invitation = null; |
| 173 | 173 | |
| 174 | - if (! empty($inviteCode)) { |
|
| 174 | + if (!empty($inviteCode)) { |
|
| 175 | 175 | $invitation = Invitation::findValidByToken($inviteCode); |
| 176 | 176 | if ($invitation) { |
| 177 | 177 | $invitedBy = $invitation->invited_by; |
| 178 | 178 | |
| 179 | 179 | // Validate email matches invitation |
| 180 | - if (! empty($invitation->email) && $invitation->email !== $email) { |
|
| 180 | + if (!empty($invitation->email) && $invitation->email !== $email) { |
|
| 181 | 181 | $error = 'Email address does not match the invitation.'; |
| 182 | 182 | |
| 183 | 183 | return $this->showRegistrationForm($request, $error); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | case 'view': |
| 232 | 232 | // See if it is a valid invite. |
| 233 | - if (($inviteCode !== null) && ! $this->isInvitationTokenValid($inviteCode)) { |
|
| 233 | + if (($inviteCode !== null) && !$this->isInvitationTokenValid($inviteCode)) { |
|
| 234 | 234 | $error = 'Invalid invitation token!'; |
| 235 | 235 | $showRegister = 0; |
| 236 | 236 | } else { |
@@ -259,14 +259,14 @@ discard block |
||
| 259 | 259 | $emailFromInvite = ''; |
| 260 | 260 | |
| 261 | 261 | if ((int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) { |
| 262 | - if (! empty($inviteCode)) { |
|
| 262 | + if (!empty($inviteCode)) { |
|
| 263 | 263 | if ($this->isInvitationTokenValid($inviteCode)) { |
| 264 | 264 | $error = ''; |
| 265 | 265 | $showRegister = 1; |
| 266 | 266 | |
| 267 | 267 | // Pre-fill email if invitation has one |
| 268 | 268 | $invitation = Invitation::findValidByToken($inviteCode); |
| 269 | - if ($invitation && ! empty($invitation->email)) { |
|
| 269 | + if ($invitation && !empty($invitation->email)) { |
|
| 270 | 270 | $emailFromInvite = $invitation->email; |
| 271 | 271 | } |
| 272 | 272 | } else { |
@@ -307,12 +307,12 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | $invitation = Invitation::findValidByToken($token); |
| 309 | 309 | |
| 310 | - if (! $invitation) { |
|
| 310 | + if (!$invitation) { |
|
| 311 | 311 | return false; |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | // If invitation has specific email, validate it matches |
| 315 | - if (! empty($invitation->email) && $invitation->email !== $email) { |
|
| 315 | + if (!empty($invitation->email) && $invitation->email !== $email) { |
|
| 316 | 316 | return false; |
| 317 | 317 | } |
| 318 | 318 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | return view('auth.passwords.email')->withErrors(['error' => 'Missing parameter (email and/or apikey) to send password reset']); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) { |
|
| 48 | + if (config('captcha.enabled') === true && (!empty(config('captcha.secret')) && !empty(config('captcha.sitekey')))) { |
|
| 49 | 49 | $validate = Validator::make($request->all(), [ |
| 50 | 50 | 'g-recaptcha-response' => 'required|captcha', |
| 51 | 51 | ]); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | // Check users exists and send an email |
| 58 | - $ret = ! empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email); |
|
| 58 | + $ret = !empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email); |
|
| 59 | 59 | if ($ret === null) { |
| 60 | 60 | return view('auth.passwords.email')->withErrors(['error' => 'The email or apikey are not recognised.']); |
| 61 | 61 | } |
@@ -52,11 +52,11 @@ |
||
| 52 | 52 | $movies[] = $result; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
| 55 | + $title = ($request->has('title') && !empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
| 56 | 56 | |
| 57 | - $actors = ($request->has('actors') && ! empty($request->input('actors'))) ? stripslashes($request->input('actors')) : ''; |
|
| 57 | + $actors = ($request->has('actors') && !empty($request->input('actors'))) ? stripslashes($request->input('actors')) : ''; |
|
| 58 | 58 | |
| 59 | - $director = ($request->has('director') && ! empty($request->input('director'))) ? stripslashes($request->input('director')) : ''; |
|
| 59 | + $director = ($request->has('director') && !empty($request->input('director'))) ? stripslashes($request->input('director')) : ''; |
|
| 60 | 60 | |
| 61 | 61 | $genres = $adult->getAllGenres(true); |
| 62 | 62 | $genre = ($request->has('genre') && \in_array($request->input('genre'), $genres, false)) ? $request->input('genre') : ''; |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $rslt = $games->getGamesRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, '', $this->userdata->categoryexclusions); |
| 38 | 38 | $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); |
| 39 | 39 | |
| 40 | - $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
| 40 | + $title = ($request->has('title') && !empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
| 41 | 41 | |
| 42 | 42 | $genres = $gen->getGenres(Genres::GAME_TYPE, true); |
| 43 | 43 | $tmpgnr = []; |
@@ -68,17 +68,17 @@ |
||
| 68 | 68 | public function destroy(array|string $id): RedirectResponse |
| 69 | 69 | { |
| 70 | 70 | $ids = null; |
| 71 | - if (! empty($id) && ! \is_array($id)) { |
|
| 71 | + if (!empty($id) && !\is_array($id)) { |
|
| 72 | 72 | $ids = explode(',', $id); |
| 73 | 73 | } elseif (\is_array($id)) { |
| 74 | 74 | $ids = $id; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - if (! empty($ids) && UsersRelease::delCartByGuid($ids, $this->userdata->id)) { |
|
| 77 | + if (!empty($ids) && UsersRelease::delCartByGuid($ids, $this->userdata->id)) { |
|
| 78 | 78 | return redirect()->to('/cart/index'); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - if (! $id) { |
|
| 81 | + if (!$id) { |
|
| 82 | 82 | return redirect()->to('/cart/index'); |
| 83 | 83 | } |
| 84 | 84 | |