@@ -16,7 +16,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
215 | -if (! function_exists('escapeString')) { |
|
215 | +if (!function_exists('escapeString')) { |
|
216 | 216 | /** |
217 | 217 | * @return string |
218 | 218 | */ |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | } |
223 | 223 | } |
224 | 224 | |
225 | -if (! function_exists('realDuration')) { |
|
225 | +if (!function_exists('realDuration')) { |
|
226 | 226 | /** |
227 | 227 | * @return string |
228 | 228 | */ |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | } |
235 | 235 | } |
236 | 236 | |
237 | -if (! function_exists('is_it_json')) { |
|
237 | +if (!function_exists('is_it_json')) { |
|
238 | 238 | /** |
239 | 239 | * @param array|string $isIt |
240 | 240 | * @return bool |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | return $zipped; |
278 | 278 | } |
279 | 279 | |
280 | -if (! function_exists('release_flag')) { |
|
280 | +if (!function_exists('release_flag')) { |
|
281 | 281 | // Function inspired by c0r3@newznabforums adds country flags on the browse page. |
282 | 282 | /** |
283 | 283 | * @param string $text Text to match against. |
@@ -413,10 +413,10 @@ discard block |
||
413 | 413 | |
414 | 414 | return ''; |
415 | 415 | } |
416 | - if (! function_exists('sanitize')) { |
|
416 | + if (!function_exists('sanitize')) { |
|
417 | 417 | function sanitize(array|string $phrases, array $doNotSanitize = []): string |
418 | 418 | { |
419 | - if (! is_array($phrases)) { |
|
419 | + if (!is_array($phrases)) { |
|
420 | 420 | $wordArray = explode(' ', str_replace('.', ' ', $phrases)); |
421 | 421 | } else { |
422 | 422 | $wordArray = $phrases; |
@@ -427,9 +427,9 @@ discard block |
||
427 | 427 | foreach ($wordArray as $words) { |
428 | 428 | $words = preg_split('/\s+/', $words); |
429 | 429 | foreach ($words as $st) { |
430 | - if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
430 | + if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
431 | 431 | $str = $st; |
432 | - } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
432 | + } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
433 | 433 | $str = $st; |
434 | 434 | } else { |
435 | 435 | $str = Sanitizer::escape($st, $doNotSanitize); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $this->setPreferences(); |
17 | 17 | $movie = new Movie(['Settings' => $this->settings]); |
18 | 18 | |
19 | - $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function ($mcat) { |
|
19 | + $moviecats = Category::getChildren(Category::MOVIE_ROOT)->map(function($mcat) { |
|
20 | 20 | return ['id' => $mcat->id, 'title' => $mcat->title]; |
21 | 21 | }); |
22 | 22 | |
@@ -40,14 +40,14 @@ discard block |
||
40 | 40 | |
41 | 41 | $orderby = $request->input('ob', ''); |
42 | 42 | $ordering = $movie->getMovieOrdering(); |
43 | - if (! in_array($orderby, $ordering, false)) { |
|
43 | + if (!in_array($orderby, $ordering, false)) { |
|
44 | 44 | $orderby = ''; |
45 | 45 | } |
46 | 46 | |
47 | 47 | $rslt = $movie->getMovieRange($page, $catarray, $offset, config('nntmux.items_per_cover_page'), $orderby, -1, $this->userdata->categoryexclusions); |
48 | 48 | $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); |
49 | 49 | |
50 | - $movies = $results->map(function ($result) { |
|
50 | + $movies = $results->map(function($result) { |
|
51 | 51 | $result['genre'] = makeFieldLinks($result, 'genre', 'movies'); |
52 | 52 | $result['actors'] = makeFieldLinks($result, 'actors', 'movies'); |
53 | 53 | $result['director'] = makeFieldLinks($result, 'director', 'movies'); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | if ($request->has('id') && ctype_digit($request->input('id'))) { |
97 | 97 | $mov = $movie->getMovieInfo($request->input('id')); |
98 | 98 | |
99 | - if (! $mov) { |
|
99 | + if (!$mov) { |
|
100 | 100 | return response()->json(['message' => 'There is no trailer for this movie.'], 404); |
101 | 101 | } |
102 | 102 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $meta_title = 'Browse Groups'; |
28 | 28 | $meta_keywords = 'browse,groups,description,details'; |
29 | 29 | $meta_description = 'Browse groups'; |
30 | - if (! empty($search)) { |
|
30 | + if (!empty($search)) { |
|
31 | 31 | $meta_title .= ' - Search: '.$search; |
32 | 32 | $meta_description = 'Browse groups search results for '.$search; |
33 | 33 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | public static function updateRelease($id, $name, $searchName, $fromName, $categoryId, $parts, $grabs, $size, $postedDate, $addedDate, $videoId, $episodeId, $imDbId, $aniDbId): void |
156 | 156 | { |
157 | 157 | $movieInfoId = null; |
158 | - if (! empty($imDbId)) { |
|
158 | + if (!empty($imDbId)) { |
|
159 | 159 | $movieInfoId = MovieInfo::whereImdbid($imDbId)->first(['id']); |
160 | 160 | } |
161 | 161 | self::whereId($id)->update( |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | |
350 | 350 | $releases = $query->get(); |
351 | 351 | |
352 | - $releases->each(function ($release) { |
|
352 | + $releases->each(function($release) { |
|
353 | 353 | $release->group_name = $release->group->name ?? null; |
354 | 354 | $release->showtitle = $release->video->title ?? null; |
355 | 355 | $release->tvdb = $release->video->tvdb ?? null; |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | $release->sub_category = $release->category->title ?? null; |
367 | 367 | $release->category_name = $release->parent_category.' > '.$release->sub_category; |
368 | 368 | $release->category_ids = $release->category->parentid.','.$release->category->id; |
369 | - $release->group_names = $release->releaseGroup->map(function ($relGroup) { |
|
369 | + $release->group_names = $release->releaseGroup->map(function($relGroup) { |
|
370 | 370 | return $relGroup->group->name; |
371 | 371 | })->implode(','); |
372 | 372 | }); |
@@ -403,12 +403,12 @@ discard block |
||
403 | 403 | |
404 | 404 | preg_match('/(^\w+[-_. ].+?\.(\d+p)).+/i', $rel['searchname'], $similar); |
405 | 405 | |
406 | - if (! empty($similar)) { |
|
406 | + if (!empty($similar)) { |
|
407 | 407 | if (config('nntmux.elasticsearch_enabled') === true) { |
408 | 408 | $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10); |
409 | 409 | } else { |
410 | 410 | $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]); |
411 | - if (! empty($searchResult)) { |
|
411 | + if (!empty($searchResult)) { |
|
412 | 412 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
413 | 413 | } |
414 | 414 | } |
@@ -50,8 +50,7 @@ |
||
50 | 50 | if ($method === '7' || $method === '8') { |
51 | 51 | $compressedHeaders = config('nntmux_nntp.compressed_headers'); |
52 | 52 | if ((config('nntmux_nntp.use_alternate_nntp_server') === true ? |
53 | - $nntp->doConnect($compressedHeaders, true) : |
|
54 | - $nntp->doConnect()) !== true) { |
|
53 | + $nntp->doConnect($compressedHeaders, true) : $nntp->doConnect()) !== true) { |
|
55 | 54 | $this->error('Unable to connect to usenet.'); |
56 | 55 | |
57 | 56 | return 1; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $limit = $this->argument('limit'); |
35 | 35 | |
36 | 36 | // Validate the limit argument |
37 | - if ($limit !== 'full' && ! is_numeric($limit)) { |
|
37 | + if ($limit !== 'full' && !is_numeric($limit)) { |
|
38 | 38 | $this->error('Limit must be "full" or a numeric value.'); |
39 | 39 | |
40 | 40 | return 1; |
@@ -114,7 +114,7 @@ |
||
114 | 114 | switch ($errorCode) { |
115 | 115 | case UPLOAD_ERR_INI_SIZE: |
116 | 116 | return "The file '{$fileName}' exceeds the upload_max_filesize directive (". |
117 | - ini_get('upload_max_filesize').').'; |
|
117 | + ini_get('upload_max_filesize').').'; |
|
118 | 118 | case UPLOAD_ERR_FORM_SIZE: |
119 | 119 | return "The file '{$fileName}' exceeds the MAX_FILE_SIZE directive specified in the HTML form."; |
120 | 120 | case UPLOAD_ERR_PARTIAL: |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $deleteNZB = true; |
27 | 27 | |
28 | 28 | // Get the list of NZB files from php /tmp folder if nzb files were uploaded. |
29 | - if (isset($_FILES['uploadedfiles']) && ! empty($_FILES['uploadedfiles']['name'][0])) { |
|
29 | + if (isset($_FILES['uploadedfiles']) && !empty($_FILES['uploadedfiles']['name'][0])) { |
|
30 | 30 | $maxFileSize = min( |
31 | 31 | $this->convertToBytes(ini_get('upload_max_filesize')), |
32 | 32 | $this->convertToBytes(ini_get('post_max_size')) |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | // Get the path the user set in the browser if he put one. |
56 | 56 | $path = ($request->has('folder') ? $request->input('folder') : ''); |
57 | - if (! Str::endsWith($path, '/')) { |
|
57 | + if (!Str::endsWith($path, '/')) { |
|
58 | 58 | $path .= '/'; |
59 | 59 | } |
60 | 60 |