@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
56 | - if (! $yesMode) { |
|
57 | - if (! $this->confirm('Are you sure you want to install NNTmux? This will wipe your database!!')) { |
|
56 | + if (!$yesMode) { |
|
57 | + if (!$this->confirm('Are you sure you want to install NNTmux? This will wipe your database!!')) { |
|
58 | 58 | $this->info('Installation aborted by user.'); |
59 | 59 | exit; |
60 | 60 | } |
@@ -97,33 +97,33 @@ discard block |
||
97 | 97 | $zip_path = config('nntmux_settings.tmp_unzip_path'); |
98 | 98 | $unrar_path = config('nntmux.tmp_unrar_path'); |
99 | 99 | |
100 | - if (! File::isWritable($nzb_path)) { |
|
100 | + if (!File::isWritable($nzb_path)) { |
|
101 | 101 | $this->warn($nzb_path.' is not writable. Please fix folder permissions'); |
102 | 102 | |
103 | 103 | return false; |
104 | 104 | } |
105 | 105 | |
106 | - if (! file_exists($unrar_path)) { |
|
106 | + if (!file_exists($unrar_path)) { |
|
107 | 107 | $this->info('Creating missing '.$unrar_path.' folder'); |
108 | - if (! @File::makeDirectory($unrar_path) && ! File::isDirectory($unrar_path)) { |
|
108 | + if (!@File::makeDirectory($unrar_path) && !File::isDirectory($unrar_path)) { |
|
109 | 109 | throw new \RuntimeException('Unable to create '.$unrar_path.' folder'); |
110 | 110 | } |
111 | 111 | $this->info('Folder '.$unrar_path.' successfully created'); |
112 | 112 | } |
113 | 113 | |
114 | - if (! is_writable($unrar_path)) { |
|
114 | + if (!is_writable($unrar_path)) { |
|
115 | 115 | $this->warn($unrar_path.' is not writable. Please fix folder permissions'); |
116 | 116 | |
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | |
120 | - if (! File::isWritable($covers_path)) { |
|
120 | + if (!File::isWritable($covers_path)) { |
|
121 | 121 | $this->warn($covers_path.' is not writable. Please fix folder permissions'); |
122 | 122 | |
123 | 123 | return false; |
124 | 124 | } |
125 | 125 | |
126 | - if (! File::isWritable($zip_path)) { |
|
126 | + if (!File::isWritable($zip_path)) { |
|
127 | 127 | $this->warn($zip_path.' is not writable. Please fix folder permissions'); |
128 | 128 | |
129 | 129 | return false; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | public static function updateRelease($id, $name, $searchName, $fromName, $categoryId, $parts, $grabs, $size, $postedDate, $addedDate, $videoId, $episodeId, $imDbId, $aniDbId): void |
145 | 145 | { |
146 | 146 | $movieInfoId = null; |
147 | - if (! empty($imDbId)) { |
|
147 | + if (!empty($imDbId)) { |
|
148 | 148 | $movieInfoId = MovieInfo::whereImdbid($imDbId)->first(['id']); |
149 | 149 | } |
150 | 150 | self::whereId($id)->update( |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | |
338 | 338 | $releases = $query->get(); |
339 | 339 | |
340 | - $releases->each(function ($release) { |
|
340 | + $releases->each(function($release) { |
|
341 | 341 | $release->group_name = $release->group->name ?? null; |
342 | 342 | $release->showtitle = $release->video->title ?? null; |
343 | 343 | $release->tvdb = $release->video->tvdb ?? null; |
@@ -389,12 +389,12 @@ discard block |
||
389 | 389 | |
390 | 390 | preg_match('/(^\w+[-_. ].+?\.(\d+p)).+/i', $rel['searchname'], $similar); |
391 | 391 | |
392 | - if (! empty($similar)) { |
|
392 | + if (!empty($similar)) { |
|
393 | 393 | if (config('nntmux.elasticsearch_enabled') === true) { |
394 | 394 | $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10); |
395 | 395 | } else { |
396 | 396 | $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]); |
397 | - if (! empty($searchResult)) { |
|
397 | + if (!empty($searchResult)) { |
|
398 | 398 | $searchResult = Arr::wrap(Arr::get($searchResult, 'id')); |
399 | 399 | } |
400 | 400 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | if (empty($email) && empty($rssToken)) { |
44 | 44 | app('smarty.view')->assign('error', 'Missing parameter (email and/or apikey) to send password reset'); |
45 | 45 | } else { |
46 | - if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) { |
|
46 | + if (config('captcha.enabled') === true && (!empty(config('captcha.secret')) && !empty(config('captcha.sitekey')))) { |
|
47 | 47 | $validate = Validator::make($request->all(), [ |
48 | 48 | 'g-recaptcha-response' => 'required|captcha', |
49 | 49 | ]); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // |
55 | 55 | // Check users exists and send an email |
56 | 56 | // |
57 | - $ret = ! empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email); |
|
57 | + $ret = !empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email); |
|
58 | 58 | if ($ret === null) { |
59 | 59 | app('smarty.view')->assign('error', 'The email or apikey are not recognised.'); |
60 | 60 | } else { |
@@ -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,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
150 | -if (! function_exists('color')) { |
|
150 | +if (!function_exists('color')) { |
|
151 | 151 | /** |
152 | 152 | * @param string $string |
153 | 153 | */ |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
160 | -if (! function_exists('human_filesize')) { |
|
160 | +if (!function_exists('human_filesize')) { |
|
161 | 161 | /** |
162 | 162 | * @param int $decimals |
163 | 163 | */ |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | } |
171 | 171 | } |
172 | 172 | |
173 | -if (! function_exists('bcdechex')) { |
|
173 | +if (!function_exists('bcdechex')) { |
|
174 | 174 | /** |
175 | 175 | * @return string |
176 | 176 | */ |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | } |
188 | 188 | } |
189 | 189 | |
190 | -if (! function_exists('runCmd')) { |
|
190 | +if (!function_exists('runCmd')) { |
|
191 | 191 | /** |
192 | 192 | * Run CLI command. |
193 | 193 | * |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | } |
217 | 217 | |
218 | -if (! function_exists('escapeString')) { |
|
218 | +if (!function_exists('escapeString')) { |
|
219 | 219 | /** |
220 | 220 | * @return string |
221 | 221 | */ |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | } |
226 | 226 | } |
227 | 227 | |
228 | -if (! function_exists('realDuration')) { |
|
228 | +if (!function_exists('realDuration')) { |
|
229 | 229 | /** |
230 | 230 | * @return string |
231 | 231 | */ |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
240 | -if (! function_exists('is_it_json')) { |
|
240 | +if (!function_exists('is_it_json')) { |
|
241 | 241 | /** |
242 | 242 | * @param array|string $isIt |
243 | 243 | * @return bool |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | return $zipped; |
281 | 281 | } |
282 | 282 | |
283 | -if (! function_exists('release_flag')) { |
|
283 | +if (!function_exists('release_flag')) { |
|
284 | 284 | // Function inspired by c0r3@newznabforums adds country flags on the browse page. |
285 | 285 | /** |
286 | 286 | * @param string $text Text to match against. |
@@ -416,10 +416,10 @@ discard block |
||
416 | 416 | |
417 | 417 | return ''; |
418 | 418 | } |
419 | - if (! function_exists('sanitize')) { |
|
419 | + if (!function_exists('sanitize')) { |
|
420 | 420 | function sanitize(array|string $phrases, array $doNotSanitize = []): string |
421 | 421 | { |
422 | - if (! is_array($phrases)) { |
|
422 | + if (!is_array($phrases)) { |
|
423 | 423 | $wordArray = explode(' ', str_replace('.', ' ', $phrases)); |
424 | 424 | } else { |
425 | 425 | $wordArray = $phrases; |
@@ -430,9 +430,9 @@ discard block |
||
430 | 430 | foreach ($wordArray as $words) { |
431 | 431 | $words = preg_split('/\s+/', $words); |
432 | 432 | foreach ($words as $st) { |
433 | - if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
433 | + if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
434 | 434 | $str = $st; |
435 | - } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
435 | + } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
436 | 436 | $str = $st; |
437 | 437 | } else { |
438 | 438 | $str = Sanitizer::escape($st, $doNotSanitize); |