Passed
Push — master ( 392926...b4a664 )
by Darko
13:01
created
app/Services/MovieBrowseService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             ."FROM movieinfo m LEFT JOIN releases r USING (imdbid) WHERE m.title != '' AND m.imdbid != '0000000' "
41 41
             ."AND r.passwordstatus {$this->showPasswords} "
42 42
             .$this->getBrowseBy().' '
43
-            .(! empty($catsrch) ? $catsrch.' ' : '')
43
+            .(!empty($catsrch) ? $catsrch.' ' : '')
44 44
             .$whereAge
45 45
             .$whereExcluded.' '
46 46
             ."GROUP BY m.imdbid ORDER BY {$order[0]} {$order[1]} {$limitClause}";
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
             Cache::put(md5($moviesSql.$page), $movies, $expiresAt);
54 54
         }
55 55
         $movieIDs = $releaseIDs = [];
56
-        if (! empty($movies['result'])) {
56
+        if (!empty($movies['result'])) {
57 57
             foreach ($movies['result'] as $id) {
58 58
                 $movieIDs[] = $id->imdbid;
59 59
                 $releaseIDs[] = $id->grp_release_id;
60 60
             }
61 61
         }
62
-        $inMovieIds = (is_array($movieIDs) && ! empty($movieIDs)) ? implode(',', $movieIDs) : -1;
63
-        $inReleaseIds = (is_array($releaseIDs) && ! empty($releaseIDs)) ? implode(',', $releaseIDs) : -1;
62
+        $inMovieIds = (is_array($movieIDs) && !empty($movieIDs)) ? implode(',', $movieIDs) : -1;
63
+        $inReleaseIds = (is_array($releaseIDs) && !empty($releaseIDs)) ? implode(',', $releaseIDs) : -1;
64 64
         $sql = 'SELECT '
65 65
             ."GROUP_CONCAT(r.id ORDER BY r.postdate DESC SEPARATOR ',' ) AS grp_release_id, "
66 66
             ."GROUP_CONCAT(r.rarinnerfilecount ORDER BY r.postdate DESC SEPARATOR ',' ) AS grp_rarinnerfilecount, "
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             .'LEFT OUTER JOIN root_categories cp ON cp.id = c.root_categories_id '
87 87
             .'INNER JOIN movieinfo m ON m.imdbid = r.imdbid '
88 88
             ."WHERE m.imdbid IN ($inMovieIds) AND r.id IN ($inReleaseIds) "
89
-            .(! empty($catsrch) ? $catsrch.' ' : '')
89
+            .(!empty($catsrch) ? $catsrch.' ' : '')
90 90
             ."GROUP BY m.imdbid ORDER BY {$order[0]} {$order[1]}";
91 91
         $return = Cache::get(md5($sql.$page));
92 92
         if ($return !== null) {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $browseBy = ' ';
131 131
         $browseByArr = ['title', 'director', 'actors', 'genre', 'rating', 'year', 'imdb'];
132 132
         foreach ($browseByArr as $bb) {
133
-            if (request()->has($bb) && ! empty(request()->input($bb))) {
133
+            if (request()->has($bb) && !empty(request()->input($bb))) {
134 134
                 $bbv = stripslashes(request()->input($bb));
135 135
                 if ($bb === 'rating') {
136 136
                     $bbv .= '.';
Please login to merge, or discard this patch.
app/Http/Controllers/DetailsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
             $re = new ReleaseExtra;
43 43
             $data = Release::getByGuid($guid);
44 44
             $releaseRegex = '';
45
-            if (! empty($data)) {
45
+            if (!empty($data)) {
46 46
                 $releaseRegex = ReleaseRegex::query()->where('releases_id', '=', $data['id'])->first();
47 47
             }
48 48
 
49
-            if (! $data) {
49
+            if (!$data) {
50 50
                 return redirect()->back();
51 51
             }
52 52
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             $mov = '';
75 75
             if ($data['imdbid'] !== '' && $data['imdbid'] !== 0000000) {
76 76
                 $mov = $this->movieService->getMovieInfo($data['imdbid']);
77
-                if (! empty($mov['title'])) {
77
+                if (!empty($mov['title'])) {
78 78
                     $mov['title'] = str_replace(['/', '\\'], '', $mov['title']);
79 79
                     $mov['actors'] = makeFieldLinks($mov, 'actors', 'movies');
80 80
                     $mov['genre'] = makeFieldLinks($mov, 'genre', 'movies');
Please login to merge, or discard this patch.
app/Http/Controllers/MovieController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function showMovies(Request $request, string $id = '')
27 27
     {
28
-        $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function ($mcat) {
28
+        $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function($mcat) {
29 29
             return ['id' => $mcat->id, 'title' => $mcat->title];
30 30
         });
31 31
 
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 
43 43
         $orderby = $request->input('ob', '');
44 44
         $ordering = $this->movieBrowseService->getMovieOrdering();
45
-        if (! in_array($orderby, $ordering, false)) {
45
+        if (!in_array($orderby, $ordering, false)) {
46 46
             $orderby = '';
47 47
         }
48 48
 
49 49
         $rslt = $this->movieBrowseService->getMovieRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, -1, $this->userdata->categoryexclusions);
50 50
         $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query());
51 51
 
52
-        $movies = $results->map(function ($result) {
52
+        $movies = $results->map(function($result) {
53 53
             $result['genre'] = makeFieldLinks($result, 'genre', 'movies');
54 54
             $result['actors'] = makeFieldLinks($result, 'actors', 'movies');
55 55
             $result['director'] = makeFieldLinks($result, 'director', 'movies');
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         // Get movie info
108 108
         $movieInfo = $this->movieService->getMovieInfo($imdbid);
109 109
 
110
-        if (! $movieInfo) {
110
+        if (!$movieInfo) {
111 111
             return redirect()->route('Movies')->with('error', 'Movie not found');
112 112
         }
113 113
 
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         // Filter to only this movie's IMDB ID
118 118
         $movieData = collect($rslt)->firstWhere('imdbid', $imdbid);
119 119
 
120
-        if (! $movieData) {
120
+        if (!$movieData) {
121 121
             return redirect()->route('Movies')->with('error', 'No releases found for this movie');
122 122
         }
123 123
 
@@ -142,13 +142,13 @@  discard block
 block discarded – undo
142 142
         }
143 143
 
144 144
         // Only process fields if they exist and are not empty
145
-        if (! empty($movieArray['genre'])) {
145
+        if (!empty($movieArray['genre'])) {
146 146
             $movieArray['genre'] = makeFieldLinks($movieArray, 'genre', 'movies');
147 147
         }
148
-        if (! empty($movieArray['actors'])) {
148
+        if (!empty($movieArray['actors'])) {
149 149
             $movieArray['actors'] = makeFieldLinks($movieArray, 'actors', 'movies');
150 150
         }
151
-        if (! empty($movieArray['director'])) {
151
+        if (!empty($movieArray['director'])) {
152 152
             $movieArray['director'] = makeFieldLinks($movieArray, 'director', 'movies');
153 153
         }
154 154
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         if ($request->has('id') && ctype_digit($request->input('id'))) {
195 195
             $mov = $this->movieService->getMovieInfo($request->input('id'));
196 196
 
197
-            if (! $mov) {
197
+            if (!$mov) {
198 198
                 return response()->json(['message' => 'There is no trailer for this movie.'], 404);
199 199
             }
200 200
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         $cacheKey = 'trending_movies_top_15_48h';
236 236
 
237 237
         // Get trending movies from cache or calculate (refresh every hour)
238
-        $trendingMovies = \Illuminate\Support\Facades\Cache::remember($cacheKey, 3600, function () {
238
+        $trendingMovies = \Illuminate\Support\Facades\Cache::remember($cacheKey, 3600, function() {
239 239
             // Calculate timestamp for 48 hours ago
240 240
             $fortyEightHoursAgo = \Illuminate\Support\Carbon::now()->subHours(48);
241 241
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                 ->get();
268 268
 
269 269
             // Process the results
270
-            return $query->map(function ($item) {
270
+            return $query->map(function($item) {
271 271
                 // Add cover image URL using helper function
272 272
                 $coverArray = [
273 273
                     'imdbid' => $item->imdbid,
Please login to merge, or discard this patch.
app/Http/Controllers/MyMoviesController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         switch ($action) {
44 44
             case 'delete':
45 45
                 $movie = UserMovie::getMovie($this->userdata->id, $imdbid);
46
-                if (! $movie) {
46
+                if (!$movie) {
47 47
                     return redirect()->to('/mymovies');
48 48
                 }
49 49
                 UserMovie::delMovie($this->userdata->id, $imdbid);
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
                 }
63 63
 
64 64
                 $movie = $this->movieService->getMovieInfo($imdbid);
65
-                if (! $movie) {
65
+                if (!$movie) {
66 66
                     return redirect()->to('/mymovies');
67 67
                 }
68 68
 
69 69
                 if ($action === 'doadd') {
70
-                    $category = ($request->has('category') && \is_array($request->input('category')) && ! empty($request->input('category'))) ? $request->input('category') : [];
70
+                    $category = ($request->has('category') && \is_array($request->input('category')) && !empty($request->input('category'))) ? $request->input('category') : [];
71 71
                     UserMovie::addMovie($this->userdata->id, $imdbid, $category);
72 72
                     if ($request->has('from')) {
73 73
                         return redirect()->to($request->input('from'));
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
             case 'doedit':
100 100
                 $movie = UserMovie::getMovie($this->userdata->id, $imdbid);
101 101
 
102
-                if (! $movie) {
102
+                if (!$movie) {
103 103
                     return redirect()->to('/mymovies');
104 104
                 }
105 105
 
106 106
                 if ($action === 'doedit') {
107
-                    $category = ($request->has('category') && \is_array($request->input('category')) && ! empty($request->input('category'))) ? $request->input('category') : [];
107
+                    $category = ($request->has('category') && \is_array($request->input('category')) && !empty($request->input('category'))) ? $request->input('category') : [];
108 108
                     UserMovie::updateMovie($this->userdata->id, $imdbid, $category);
109 109
                     if ($request->has('from')) {
110 110
                         return redirect()->to($request->input('from'));
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                     if (\is_array($showcats) && \count($showcats) > 0) {
148 148
                         $catarr = [];
149 149
                         foreach ($showcats as $scat) {
150
-                            if (! empty($scat)) {
150
+                            if (!empty($scat)) {
151 151
                                 $catarr[] = $categories[$scat];
152 152
                             }
153 153
                         }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                     if (\is_array($showcats) && \count($showcats) > 0) {
198 198
                         $catarr = [];
199 199
                         foreach ($showcats as $scat) {
200
-                            if (! empty($scat)) {
200
+                            if (!empty($scat)) {
201 201
                                 $catarr[] = $categories[$scat];
202 202
                             }
203 203
                         }
Please login to merge, or discard this patch.
app/Http/Resources/MovieResource.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      */
50 50
     protected function getCoverUrl(): ?string
51 51
     {
52
-        if (! $this->cover || ! $this->imdbid) {
52
+        if (!$this->cover || !$this->imdbid) {
53 53
             return null;
54 54
         }
55 55
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     protected function getBackdropUrl(): ?string
63 63
     {
64
-        if (! $this->backdrop || ! $this->imdbid) {
64
+        if (!$this->backdrop || !$this->imdbid) {
65 65
             return null;
66 66
         }
67 67
 
Please login to merge, or discard this patch.