Passed
Push — master ( 81d372...6d37f9 )
by Darko
13:53 queued 01:34
created
app/Http/Controllers/BasePageController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,12 +60,12 @@
 block discarded – undo
60 60
 
61 61
         // Then add the converted settings array as 'site'
62 62
         // Using array assignment instead of constructor assignment to ensure it persists
63
-        $this->viewData['site'] = $this->settings->map(function ($value) {
63
+        $this->viewData['site'] = $this->settings->map(function($value) {
64 64
             return Settings::convertValue($value);
65 65
         })->all();
66 66
 
67 67
         // Initialize userdata property for controllers that need it
68
-        $this->middleware(function ($request, $next) {
68
+        $this->middleware(function($request, $next) {
69 69
             if (Auth::check()) {
70 70
                 $this->userdata = User::find(Auth::id());
71 71
                 $this->userdata->categoryexclusions = User::getCategoryExclusionById(Auth::id());
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
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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');
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         // Get movie info
100 100
         $movieInfo = $movie->getMovieInfo($imdbid);
101 101
 
102
-        if (! $movieInfo) {
102
+        if (!$movieInfo) {
103 103
             return redirect()->route('Movies')->with('error', 'Movie not found');
104 104
         }
105 105
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         // Filter to only this movie's IMDB ID
110 110
         $movieData = collect($rslt)->firstWhere('imdbid', $imdbid);
111 111
 
112
-        if (! $movieData) {
112
+        if (!$movieData) {
113 113
             return redirect()->route('Movies')->with('error', 'No releases found for this movie');
114 114
         }
115 115
 
@@ -134,13 +134,13 @@  discard block
 block discarded – undo
134 134
         }
135 135
 
136 136
         // Only process fields if they exist and are not empty
137
-        if (! empty($movieArray['genre'])) {
137
+        if (!empty($movieArray['genre'])) {
138 138
             $movieArray['genre'] = makeFieldLinks($movieArray, 'genre', 'movies');
139 139
         }
140
-        if (! empty($movieArray['actors'])) {
140
+        if (!empty($movieArray['actors'])) {
141 141
             $movieArray['actors'] = makeFieldLinks($movieArray, 'actors', 'movies');
142 142
         }
143
-        if (! empty($movieArray['director'])) {
143
+        if (!empty($movieArray['director'])) {
144 144
             $movieArray['director'] = makeFieldLinks($movieArray, 'director', 'movies');
145 145
         }
146 146
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         if ($request->has('id') && ctype_digit($request->input('id'))) {
189 189
             $mov = $movie->getMovieInfo($request->input('id'));
190 190
 
191
-            if (! $mov) {
191
+            if (!$mov) {
192 192
                 return response()->json(['message' => 'There is no trailer for this movie.'], 404);
193 193
             }
194 194
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         $cacheKey = 'trending_movies_top_15_48h';
231 231
 
232 232
         // Get trending movies from cache or calculate (refresh every hour)
233
-        $trendingMovies = \Illuminate\Support\Facades\Cache::remember($cacheKey, 3600, function () {
233
+        $trendingMovies = \Illuminate\Support\Facades\Cache::remember($cacheKey, 3600, function() {
234 234
             // Calculate timestamp for 48 hours ago
235 235
             $fortyEightHoursAgo = \Illuminate\Support\Carbon::now()->subHours(48);
236 236
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                 ->get();
263 263
 
264 264
             // Process the results
265
-            return $query->map(function ($item) {
265
+            return $query->map(function($item) {
266 266
                 // Add cover image URL using helper function
267 267
                 $coverArray = [
268 268
                     'imdbid' => $item->imdbid,
Please login to merge, or discard this patch.
app/Http/Controllers/PasswordSecurityController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $user = $request->user();
88 88
 
89 89
         // Only allow canceling if 2FA is not yet enabled
90
-        if ($user->passwordSecurity()->exists() && ! $user->passwordSecurity->google2fa_enable) {
90
+        if ($user->passwordSecurity()->exists() && !$user->passwordSecurity->google2fa_enable) {
91 91
             $user->passwordSecurity()->delete();
92 92
 
93 93
             return redirect()->to('profileedit#security')->with('success_2fa', '2FA setup has been cancelled.');
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
     public function disable2fa(Disable2faPasswordSecurityRequest $request): \Illuminate\Routing\Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application
100 100
     {
101
-        if (! (Hash::check($request->get('current-password'), $request->user()->password))) {
101
+        if (!(Hash::check($request->get('current-password'), $request->user()->password))) {
102 102
             // Password doesn't match - always redirect to profile page with error
103 103
             return redirect()->to('profileedit#security')->with('error_2fa', 'Your password does not match with your account password. Please try again.');
104 104
         }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         ]);
127 127
 
128 128
         // Get the user ID from session
129
-        if (! $request->session()->has('2fa:user:id')) {
129
+        if (!$request->session()->has('2fa:user:id')) {
130 130
             return redirect()->route('login')
131 131
                 ->with('message', 'The two-factor authentication session has expired. Please login again.')
132 132
                 ->with('message_type', 'danger');
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         $userId = $request->session()->get('2fa:user:id');
136 136
         $user = \App\Models\User::find($userId);
137 137
 
138
-        if (! $user || ! $user->passwordSecurity) {
138
+        if (!$user || !$user->passwordSecurity) {
139 139
             $request->session()->forget('2fa:user:id');
140 140
 
141 141
             return redirect()->route('login')
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             $request->input('one_time_password')
150 150
         );
151 151
 
152
-        if (! $valid) {
152
+        if (!$valid) {
153 153
             return redirect()->route('2fa.verify')
154 154
                 ->with('message', 'Invalid authentication code. Please try again.')
155 155
                 ->with('message_type', 'danger');
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
     public function getVerify2fa(Request $request)
227 227
     {
228 228
         // Check if user ID is stored in the session
229
-        if (! $request->session()->has('2fa:user:id')) {
229
+        if (!$request->session()->has('2fa:user:id')) {
230 230
             return redirect()->route('login')
231 231
                 ->withErrors(['msg' => 'The two-factor authentication session has expired. Please login again.']);
232 232
         }
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 
237 237
         // Get the user
238 238
         $user = \App\Models\User::find($userId);
239
-        if (! $user) {
239
+        if (!$user) {
240 240
             $request->session()->forget('2fa:user:id');
241 241
 
242 242
             return redirect()->route('login')
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
             'current-password' => 'required',
257 257
         ]);
258 258
 
259
-        if (! (Hash::check($request->get('current-password'), $request->user()->password))) {
259
+        if (!(Hash::check($request->get('current-password'), $request->user()->password))) {
260 260
             return redirect()->to('profileedit#security')->with('error_2fa', 'Your password does not match with your account password. Please try again.');
261 261
         }
262 262
 
Please login to merge, or discard this patch.
app/Http/Controllers/GetNzbController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     {
24 24
 
25 25
         // If guid is passed as URL parameter, merge it into request as 'id'
26
-        if ($guid !== null && ! $request->has('id')) {
26
+        if ($guid !== null && !$request->has('id')) {
27 27
             $request->merge(['id' => $guid]);
28 28
         }
29 29
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             }
43 43
 
44 44
             $res = User::getByRssToken($request->input('r'));
45
-            if (! $res) {
45
+            if (!$res) {
46 46
                 return Utility::showApiError(100);
47 47
             }
48 48
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             return Utility::showApiError(501);
62 62
         }
63 63
 
64
-        if (! $request->input('id')) {
64
+        if (!$request->input('id')) {
65 65
             return Utility::showApiError(200, 'Parameter id is required');
66 66
         }
67 67
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
         $nzbPath = (new NZB)->getNZBPath($request->input('id'));
99 99
 
100
-        if (! File::exists($nzbPath)) {
100
+        if (!File::exists($nzbPath)) {
101 101
             return Utility::showApiError(300, 'NZB file not found!');
102 102
         }
103 103
 
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
             'X-DNZB-Details' => url('/details/'.$request->input('id')),
125 125
         ];
126 126
 
127
-        if (! empty($relData['imdbid']) && $relData['imdbid'] > 0) {
127
+        if (!empty($relData['imdbid']) && $relData['imdbid'] > 0) {
128 128
             $headers['X-DNZB-MoreInfo'] = 'http://www.imdb.com/title/tt'.$relData['imdbid'];
129
-        } elseif (! empty($relData['tvdb']) && $relData['tvdb'] > 0) {
129
+        } elseif (!empty($relData['tvdb']) && $relData['tvdb'] > 0) {
130 130
             $headers['X-DNZB-MoreInfo'] = 'http://www.thetvdb.com/?tab=series&id='.$relData['tvdb'];
131 131
         }
132 132
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
         $final = '';
157 157
         // Keep repeating until the end of the input file
158
-        while (! gzeof($zd)) {
158
+        while (!gzeof($zd)) {
159 159
             // Read buffer-size bytes
160 160
             $contents = gzread($zd, $buffer_size);
161 161
             $tmp = preg_replace('/file poster=\"/i', 'file poster="'.$uid.'-', $contents, 10);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         // Sanitize file name
170 170
         $cleanName = str_replace([',', ' ', '/', '\\'], '_', $relData['searchname']);
171 171
 
172
-        return response()->streamDownload(function () use ($final) {
172
+        return response()->streamDownload(function() use ($final) {
173 173
             echo $final;
174 174
         }, $cleanName.'.nzb', $headers);
175 175
     }
Please login to merge, or discard this patch.
app/Http/Controllers/ContactUsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
                 }
31 31
             }
32 32
 
33
-            if (! preg_match("/\n/i", $request->input('useremail'))) {
33
+            if (!preg_match("/\n/i", $request->input('useremail'))) {
34 34
                 SendContactUsEmail::dispatch($email, $mailTo, $mailBody)->onQueue('contactemail');
35 35
             }
36 36
             $msg = "<h2 style='text-align:center;'>Thank you for getting in touch with ".config('app.name').'.</h2>';
Please login to merge, or discard this patch.
app/Http/Controllers/Api/ApiController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $releases = new Releases;
124 124
 
125 125
         // Set Query Parameters based on Request objects
126
-        $outputXML = ! ($request->has('o') && $request->input('o') === 'json');
126
+        $outputXML = !($request->has('o') && $request->input('o') === 'json');
127 127
         $minSize = $request->has('minsize') && $request->input('minsize') > 0 ? $request->input('minsize') : 0;
128 128
         $offset = $this->offset($request);
129 129
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
                 $this->addCoverURL(
266 266
                     $relData,
267
-                    function ($release) {
267
+                    function($release) {
268 268
                         return Utility::getCoverURL(['type' => 'movies', 'id' => $release->imdbid]);
269 269
                     }
270 270
                 );
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 
307 307
                 if ($rel && $rel->isNotEmpty()) {
308 308
                     $data = ReleaseNfo::getReleaseNfo($rel->id);
309
-                    if (! empty($data)) {
309
+                    if (!empty($data)) {
310 310
                         if ($request->has('o') && $request->input('o') === 'file') {
311
-                            return response()->streamDownload(function () use ($data) {
311
+                            return response()->streamDownload(function() use ($data) {
312 312
                                 echo $data['nfo'];
313 313
                             }, $rel['searchname'].'.nfo', ['Content-type:' => 'application/octet-stream']);
314 314
                         }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
                 // curl -X POST -F "file=@./The.File.nzb" "https://www.tabula-rasa.pw/api/V1/api?t=nzbadd&apikey=xxx"
327 327
                 //
328 328
             case 'nzbAdd':
329
-                if (! User::canPost($uid)) {
329
+                if (!User::canPost($uid)) {
330 330
                     return response('User does not have permission to post', 403);
331 331
                 }
332 332
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
                     return response('Missing parameter (apikey is required for adding an NZB)', 400);
338 338
                 }
339 339
 
340
-                if (! $request->hasFile('file')) {
340
+                if (!$request->hasFile('file')) {
341 341
                     return response('Missing parameter (file is required for adding an NZB)', 400);
342 342
                 }
343 343
 
@@ -352,10 +352,10 @@  discard block
 block discarded – undo
352 352
                         return response('File is not an NZB file', 400);
353 353
                     }
354 354
                     // Check if the file is proper xml nzb file.
355
-                    if (! Utility::isValidNewznabNzb($nzbFile->getContent())) {
355
+                    if (!Utility::isValidNewznabNzb($nzbFile->getContent())) {
356 356
                         return response('File is not a valid Newznab NZB file', 400);
357 357
                     }
358
-                    if (! File::isDirectory(config('nntmux.nzb_upload_folder'))) {
358
+                    if (!File::isDirectory(config('nntmux.nzb_upload_folder'))) {
359 359
                         @File::makeDirectory(config('nntmux.nzb_upload_folder'), 0775, true);
360 360
                     }
361 361
 
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
             header('Content-type: text/xml');
403 403
         } else {
404 404
             // JSON encode the XMLWriter response
405
-            $response = json_encode(xml_to_array($response), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES);
405
+            $response = json_encode(xml_to_array($response), JSON_THROW_ON_ERROR|JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES);
406 406
             header('Content-type: application/json');
407 407
         }
408 408
         if ($response === false) {
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
                 'search' => ['available' => 'yes', 'supportedParams' => 'q'],
446 446
                 'tv-search' => ['available' => 'yes', 'supportedParams' => 'q,vid,tvdbid,traktid,rid,tvmazeid,imdbid,tmdbid,season,ep'],
447 447
                 'movie-search' => ['available' => 'yes', 'supportedParams' => 'q,imdbid, tmdbid, traktid'],
448
-                'audio-search' => ['available' => 'no',  'supportedParams' => ''],
448
+                'audio-search' => ['available' => 'no', 'supportedParams' => ''],
449 449
             ],
450 450
             'categories' => $this->type === 'caps'
451 451
                 ? Category::getForMenu()
@@ -460,9 +460,9 @@  discard block
 block discarded – undo
460 460
     {
461 461
         $maxAge = -1;
462 462
         if ($request->has('maxage')) {
463
-            if (! $request->filled('maxage')) {
463
+            if (!$request->filled('maxage')) {
464 464
                 return Utility::showApiError(201, 'Incorrect parameter (maxage must not be empty)');
465
-            } elseif (! is_numeric($request->input('maxage'))) {
465
+            } elseif (!is_numeric($request->input('maxage'))) {
466 466
                 return Utility::showApiError(201, 'Incorrect parameter (maxage must be numeric)');
467 467
             } else {
468 468
                 $maxAge = (int) $request->input('maxage');
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
         if ($request->has('cat')) {
482 482
             $categoryIDs = urldecode($request->input('cat'));
483 483
             // Append Web-DL category ID if HD present for SickBeard / Sonarr compatibility.
484
-            if (str_contains($categoryIDs, (string) Category::TV_HD) && ! str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('catwebdl') === 0) {
484
+            if (str_contains($categoryIDs, (string) Category::TV_HD) && !str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('catwebdl') === 0) {
485 485
                 $categoryIDs .= (','.Category::TV_WEBDL);
486 486
             }
487 487
             $categoryID = explode(',', $categoryIDs);
Please login to merge, or discard this patch.
app/Models/Release.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     public static function updateRelease($id, $name, $searchName, $fromName, $categoryId, $parts, $grabs, $size, $postedDate, $addedDate, $videoId, $episodeId, $imDbId, $aniDbId): void
151 151
     {
152 152
         $movieInfoId = null;
153
-        if (! empty($imDbId)) {
153
+        if (!empty($imDbId)) {
154 154
             $movieInfoId = MovieInfo::whereImdbid($imDbId)->first(['id']);
155 155
         }
156 156
         self::whereId($id)->update(
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
         $releases = $query->get();
343 343
 
344
-        $releases->each(function ($release) {
344
+        $releases->each(function($release) {
345 345
             $release->group_name = $release->group->name ?? null;
346 346
             $release->showtitle = $release->video->title ?? null;
347 347
             $release->tvdb = $release->video->tvdb ?? null;
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
             $release->sub_category = $release->category->title ?? null;
359 359
             $release->category_name = $release->parent_category.' > '.$release->sub_category;
360 360
             $release->category_ids = $release->category ? ($release->category->parentid.','.$release->category->id) : '';
361
-            $release->group_names = $release->releaseGroup->map(function ($relGroup) {
361
+            $release->group_names = $release->releaseGroup->map(function($relGroup) {
362 362
                 return $relGroup->group ? $relGroup->group->name : null;
363 363
             })->implode(',');
364 364
         });
@@ -395,12 +395,12 @@  discard block
 block discarded – undo
395 395
 
396 396
         preg_match('/(^\w+[-_. ].+?\.(\d+p)).+/i', $rel['searchname'], $similar);
397 397
 
398
-        if (! empty($similar)) {
398
+        if (!empty($similar)) {
399 399
             if (config('nntmux.elasticsearch_enabled') === true) {
400 400
                 $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10);
401 401
             } else {
402 402
                 $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]);
403
-                if (! empty($searchResult)) {
403
+                if (!empty($searchResult)) {
404 404
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
405 405
                 }
406 406
             }
Please login to merge, or discard this patch.
app/Extensions/helper/helpers.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 use Symfony\Component\Process\Process;
17 17
 use Zip as ZipStream;
18 18
 
19
-if (! function_exists('getRawHtml')) {
19
+if (!function_exists('getRawHtml')) {
20 20
     /**
21 21
      * @param  bool  $cookie
22 22
      * @return bool|mixed|string
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     }
52 52
 }
53 53
 
54
-if (! function_exists('makeFieldLinks')) {
54
+if (!function_exists('makeFieldLinks')) {
55 55
     /**
56 56
      * @return string
57 57
      *
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     }
82 82
 }
83 83
 
84
-if (! function_exists('getUserBrowseOrder')) {
84
+if (!function_exists('getUserBrowseOrder')) {
85 85
     /**
86 86
      * @param  string  $orderBy
87 87
      */
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     }
108 108
 }
109 109
 
110
-if (! function_exists('getUserBrowseOrdering')) {
110
+if (!function_exists('getUserBrowseOrdering')) {
111 111
     function getUserBrowseOrdering(): array
112 112
     {
113 113
         return [
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     }
138 138
 }
139 139
 
140
-if (! function_exists('getSimilarName')) {
140
+if (!function_exists('getSimilarName')) {
141 141
     /**
142 142
      * @param  string  $name
143 143
      */
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
     }
148 148
 }
149 149
 
150
-if (! function_exists('color')) {
150
+if (!function_exists('color')) {
151 151
     function color(string $string = ''): Color
152 152
     {
153 153
         return new Color($string);
154 154
     }
155 155
 }
156 156
 
157
-if (! function_exists('human_filesize')) {
157
+if (!function_exists('human_filesize')) {
158 158
     /**
159 159
      * @param  int  $decimals
160 160
      */
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     }
168 168
 }
169 169
 
170
-if (! function_exists('bcdechex')) {
170
+if (!function_exists('bcdechex')) {
171 171
     /**
172 172
      * @return string
173 173
      */
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
     }
185 185
 }
186 186
 
187
-if (! function_exists('runCmd')) {
187
+if (!function_exists('runCmd')) {
188 188
     /**
189 189
      * Run CLI command.
190 190
      *
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     }
213 213
 }
214 214
 
215
-if (! function_exists('escapeString')) {
215
+if (!function_exists('escapeString')) {
216 216
 
217 217
     function escapeString($string): string
218 218
     {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     }
221 221
 }
222 222
 
223
-if (! function_exists('realDuration')) {
223
+if (!function_exists('realDuration')) {
224 224
 
225 225
     function realDuration($milliseconds): string
226 226
     {
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     }
231 231
 }
232 232
 
233
-if (! function_exists('is_it_json')) {
233
+if (!function_exists('is_it_json')) {
234 234
     /**
235 235
      * @throws JsonException
236 236
      */
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     }
246 246
 }
247 247
 
248
-if (! function_exists('getStreamingZip')) {
248
+if (!function_exists('getStreamingZip')) {
249 249
     /**
250 250
      * @throws Exception
251 251
      */
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
     }
273 273
 }
274 274
 
275
-if (! function_exists('release_flag')) {
275
+if (!function_exists('release_flag')) {
276 276
     // Function inspired by c0r3@newznabforums adds country flags on the browse page.
277 277
     /**
278 278
      * @param  string  $text  Text to match against.
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
     }
410 410
 }
411 411
 
412
-if (! function_exists('getReleaseCover')) {
412
+if (!function_exists('getReleaseCover')) {
413 413
     /**
414 414
      * Get the cover image URL for a release based on its type and ID
415 415
      *
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         $coverId = null;
423 423
 
424 424
         // Helper function to get value from object or array
425
-        $getValue = function ($data, $key) {
425
+        $getValue = function($data, $key) {
426 426
             if (is_array($data)) {
427 427
                 return $data[$key] ?? null;
428 428
             } elseif (is_object($data)) {
@@ -441,25 +441,25 @@  discard block
 block discarded – undo
441 441
         $xxxinfo_id = $getValue($release, 'xxxinfo_id');
442 442
         $anidbid = $getValue($release, 'anidbid');
443 443
 
444
-        if (! empty($imdbid) && $imdbid > 0) {
444
+        if (!empty($imdbid) && $imdbid > 0) {
445 445
             $coverType = 'movies';
446 446
             $coverId = str_pad($imdbid, 7, '0', STR_PAD_LEFT);
447
-        } elseif (! empty($musicinfo_id)) {
447
+        } elseif (!empty($musicinfo_id)) {
448 448
             $coverType = 'music';
449 449
             $coverId = $musicinfo_id;
450
-        } elseif (! empty($consoleinfo_id)) {
450
+        } elseif (!empty($consoleinfo_id)) {
451 451
             $coverType = 'console';
452 452
             $coverId = $consoleinfo_id;
453
-        } elseif (! empty($bookinfo_id)) {
453
+        } elseif (!empty($bookinfo_id)) {
454 454
             $coverType = 'book';
455 455
             $coverId = $bookinfo_id;
456
-        } elseif (! empty($gamesinfo_id)) {
456
+        } elseif (!empty($gamesinfo_id)) {
457 457
             $coverType = 'games';
458 458
             $coverId = $gamesinfo_id;
459
-        } elseif (! empty($xxxinfo_id)) {
459
+        } elseif (!empty($xxxinfo_id)) {
460 460
             $coverType = 'xxx';
461 461
             $coverId = $xxxinfo_id;
462
-        } elseif (! empty($anidbid)) {
462
+        } elseif (!empty($anidbid)) {
463 463
             $coverType = 'anime';
464 464
             $coverId = $anidbid;
465 465
         }
@@ -475,10 +475,10 @@  discard block
 block discarded – undo
475 475
     }
476 476
 }
477 477
 
478
-if (! function_exists('sanitize')) {
478
+if (!function_exists('sanitize')) {
479 479
     function sanitize(array|string $phrases, array $doNotSanitize = []): string
480 480
     {
481
-        if (! is_array($phrases)) {
481
+        if (!is_array($phrases)) {
482 482
             $wordArray = explode(' ', str_replace('.', ' ', $phrases));
483 483
         } else {
484 484
             $wordArray = $phrases;
@@ -489,9 +489,9 @@  discard block
 block discarded – undo
489 489
         foreach ($wordArray as $words) {
490 490
             $words = preg_split('/\s+/', $words);
491 491
             foreach ($words as $st) {
492
-                if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) {
492
+                if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) {
493 493
                     $str = $st;
494
-                } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) {
494
+                } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) {
495 495
                     $str = $st;
496 496
                 } else {
497 497
                     $str = Sanitizer::escape($st, $doNotSanitize);
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
     }
507 507
 }
508 508
 
509
-if (! function_exists('formatBytes')) {
509
+if (!function_exists('formatBytes')) {
510 510
     /**
511 511
      * Format bytes into human-readable file size.
512 512
      *
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
     }
526 526
 }
527 527
 
528
-if (! function_exists('csp_nonce')) {
528
+if (!function_exists('csp_nonce')) {
529 529
     /**
530 530
      * Generate a CSP nonce for inline scripts
531 531
      * This should be stored in the request and reused across the request lifecycle
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
     }
543 543
 }
544 544
 
545
-if (! function_exists('userDate')) {
545
+if (!function_exists('userDate')) {
546 546
     /**
547 547
      * Format a date/time string according to the authenticated user's timezone
548 548
      *
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
     }
575 575
 }
576 576
 
577
-if (! function_exists('userDateDiffForHumans')) {
577
+if (!function_exists('userDateDiffForHumans')) {
578 578
     /**
579 579
      * Format a date/time string as a human-readable diff according to the authenticated user's timezone
580 580
      *
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
     }
606 606
 }
607 607
 
608
-if (! function_exists('getAvailableTimezones')) {
608
+if (!function_exists('getAvailableTimezones')) {
609 609
     /**
610 610
      * Get a list of available timezones grouped by region
611 611
      *
Please login to merge, or discard this patch.
app/View/Composers/GlobalDataComposer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
         $viewData = [
26 26
             'serverroot' => url('/'),
27
-            'site' => $siteArray,  // Now it's a proper array, not a Settings model
27
+            'site' => $siteArray, // Now it's a proper array, not a Settings model
28 28
             'theme' => 'Gentele',
29 29
         ];
30 30
 
Please login to merge, or discard this patch.