Passed
Branch dev (a25f63)
by Darko
15:17
created
nntmux/Hotmovies.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			$ch = curl_init($this->directLink);
113 113
 			$this->directLink = "";
114 114
 		}
115
-		if ($usepost === true){
115
+		if ($usepost === true) {
116 116
 			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
117 117
 			curl_setopt($ch, CURLOPT_POST, 1);
118 118
 			curl_setopt($ch, CURLOPT_POSTFIELDS, $this->_postParams);
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
 			$results = array_merge($results, $this->covers());
190 190
 		}
191 191
 
192
-		if (empty($results) === true){
192
+		if (empty($results) === true) {
193 193
 			return false;
194
-		}else{
194
+		} else {
195 195
 			return $results;
196 196
 		}
197 197
 	}
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 	public function sypnosis()
205 205
 	{
206 206
 		if ($this->_html->find('.desc_link', 0)) {
207
-			preg_match("/var descfullcontent = (?<content>.*)/", $this->_response,$matches);
207
+			preg_match("/var descfullcontent = (?<content>.*)/", $this->_response, $matches);
208 208
 			if (is_array($matches)) {
209 209
 				$this->_res['sypnosis'] = rawurldecode($matches['content']);
210 210
 			}
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 		if ($this->_html->find('a[itemprop=actor]')) {
274 274
 			foreach ($this->_html->find('a[itemprop=actor]') as $e) {
275 275
 				$e = trim($e->title);
276
-				$e = preg_replace('/\((.*)\)/',"",$e);
276
+				$e = preg_replace('/\((.*)\)/', "", $e);
277 277
 				$cast[] = trim($e);
278 278
 			}
279 279
 			$this->_res['cast'] = & $cast;
@@ -291,10 +291,10 @@  discard block
 block discarded – undo
291 291
 	public function genres()
292 292
 	{
293 293
 		$genres = [];
294
-		if ($ret = $this->_html->find('div.categories',0)) {
294
+		if ($ret = $this->_html->find('div.categories', 0)) {
295 295
 			foreach ($ret->find('a') as $e) {
296 296
 				if (stristr($e->title, "->")) {
297
-					$e = explode("->",$e->plaintext);
297
+					$e = explode("->", $e->plaintext);
298 298
 					$genres[] = trim($e[1]);
299 299
 				}
300 300
 			}
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 		if ($ret = $this->_html->find('div#large_cover, img#cover', 1)) {
315 315
 			$this->_res['boxcover'] = trim($ret->src);
316 316
 			$this->_res['backcover'] = str_ireplace(".cover", ".back", trim($ret->src));
317
-		}else{
317
+		} else {
318 318
 			return false;
319 319
 		}
320 320
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 			return false;
336 336
 		} else {
337 337
 			if ($ret = $this->_html->find('h3[class=title]', 0)) {
338
-				if ($ret->find('a[title]',0)){
338
+				if ($ret->find('a[title]', 0)) {
339 339
 					$ret = $ret->find('a[title]', 0);
340 340
 					$title = trim($ret->title);
341 341
 					$title = preg_replace('/XXX/', '', $title);
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			$ch = curl_init($this->directLink);
113 113
 			$this->directLink = "";
114 114
 		}
115
-		if ($usepost === true){
115
+		if ($usepost === true) {
116 116
 			curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
117 117
 			curl_setopt($ch, CURLOPT_POST, 1);
118 118
 			curl_setopt($ch, CURLOPT_POSTFIELDS, $this->_postParams);
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
 			$results = array_merge($results, $this->covers());
190 190
 		}
191 191
 
192
-		if (empty($results) === true){
192
+		if (empty($results) === true) {
193 193
 			return false;
194
-		}else{
194
+		} else {
195 195
 			return $results;
196 196
 		}
197 197
 	}
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 		if ($ret = $this->_html->find('div#large_cover, img#cover', 1)) {
315 315
 			$this->_res['boxcover'] = trim($ret->src);
316 316
 			$this->_res['backcover'] = str_ireplace(".cover", ".back", trim($ret->src));
317
-		}else{
317
+		} else {
318 318
 			return false;
319 319
 		}
320 320
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 			return false;
336 336
 		} else {
337 337
 			if ($ret = $this->_html->find('h3[class=title]', 0)) {
338
-				if ($ret->find('a[title]',0)){
338
+				if ($ret->find('a[title]',0)) {
339 339
 					$ret = $ret->find('a[title]', 0);
340 340
 					$title = trim($ret->title);
341 341
 					$title = preg_replace('/XXX/', '', $title);
Please login to merge, or discard this patch.
nntmux/db/Settings.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@
 block discarded – undo
214 214
 
215 215
 			$table = $this->table();
216 216
 			$this->queryExec(
217
-				 sprintf("UPDATE $table SET value = CASE setting %s END WHERE setting IN (%s)",
217
+				 sprintf("update $table SET value = CASE setting %s END WHERE setting IN (%s)",
218 218
 						 implode(' ', $sql),
219 219
 						 implode(', ', $sqlKeys)
220 220
 				 )
Please login to merge, or discard this patch.
nntmux/db/PreDb.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			'enclosedby'	=> '',
83 83
 			'fields'		=> '\t',
84 84
 			'limit'			=> 0,
85
-			'lines'			=> '\r\n',    // use Windows style endings so that text can contain \n
85
+			'lines'			=> '\r\n', // use Windows style endings so that text can contain \n
86 86
 			'local'			=> false,
87 87
 			'path'			=> null,
88 88
 		];
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
 		$enclosedby = empty($options['enclosedby']) ? '' : "ENCLOSED BY {$this->escapeString($options['enclosedby'])}";
100 100
 
101
-		$sql   = <<<SQL_EXPORT
101
+		$sql = <<<SQL_EXPORT
102 102
 SELECT title, nfo, size, files, filename, nuked, nukereason, category, predate, source, requestid, g.name
103 103
 	FROM {$this->tableMain} p LEFT OUTER JOIN groups g ON p.groups_id = g.id $limit
104 104
 	INTO OUTFILE '{$options['path']}'
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 		$defaults = [
265 265
 			'enclosedby'	=> "'",
266 266
 			'fields'		=> '\t',
267
-			'lines'			=> '\r\n',    // Windows' style EOL to allow \n to be used in text.
267
+			'lines'			=> '\r\n', // Windows' style EOL to allow \n to be used in text.
268 268
 			'local'			=> false,
269 269
 			'optional'		=> true,
270 270
 		];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
 			return null;
95 95
 		}
96 96
 
97
-		$limit = $options['limit'] > 0 ? "LIMIT {$options['limit']}" : '';
97
+		$limit = $options['limit'] > 0 ? "limit {$options['limit']}" : '';
98 98
 
99 99
 		$enclosedby = empty($options['enclosedby']) ? '' : "ENCLOSED BY {$this->escapeString($options['enclosedby'])}";
100 100
 
Please login to merge, or discard this patch.
nntmux/processing/ProcessReleases.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,8 +101,8 @@
 block discarded – undo
101 101
 	public $releaseImage;
102 102
 
103 103
 	/**
104
-	* @var int Time (hours) to wait before creating a stuck collection into a release.
105
-	*/
104
+	 * @var int Time (hours) to wait before creating a stuck collection into a release.
105
+	 */
106 106
 	private $collectionTimeout;
107 107
 
108 108
 	/**
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 
19 19
 class ProcessReleases
20 20
 {
21
-	const COLLFC_DEFAULT  =  0; // Collection has default filecheck status
22
-	const COLLFC_COMPCOLL =  1; // Collection is a complete collection
23
-	const COLLFC_COMPPART =  2; // Collection is a complete collection and has all parts available
24
-	const COLLFC_SIZED    =  3; // Collection has been calculated for total size
25
-	const COLLFC_INSERTED =  4; // Collection has been inserted into releases
26
-	const COLLFC_DELETE   =  5; // Collection is ready for deletion
21
+	const COLLFC_DEFAULT  = 0; // Collection has default filecheck status
22
+	const COLLFC_COMPCOLL = 1; // Collection is a complete collection
23
+	const COLLFC_COMPPART = 2; // Collection is a complete collection and has all parts available
24
+	const COLLFC_SIZED    = 3; // Collection has been calculated for total size
25
+	const COLLFC_INSERTED = 4; // Collection has been inserted into releases
26
+	const COLLFC_DELETE   = 5; // Collection is ready for deletion
27 27
 	const COLLFC_TEMPCOMP = 15; // Collection is complete and being checked for complete parts
28 28
 	const COLLFC_ZEROPART = 16; // Collection has a 00/0XX designator (temporary)
29 29
 
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
 
912 912
 		// Cleanup orphaned collections, binaries and parts
913 913
 		// this really shouldn't happen, but just incase - so we only run 1/200 of the time
914
-		if (mt_rand(0, 200) <= 1 ) {
914
+		if (mt_rand(0, 200) <= 1) {
915 915
 			// CBP collection orphaned with no binaries or parts.
916 916
 			if ($this->echoCLI) {
917 917
 				echo (
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
 	 */
1425 1425
 	private function maxQueryFormulator($groupName, $difference)
1426 1426
 	{
1427
-		$maxID = $this->pdo->queryOneRow(sprintf('SELECT IFNULL(MAX(id),0) AS max FROM %s', $groupName ));
1427
+		$maxID = $this->pdo->queryOneRow(sprintf('SELECT IFNULL(MAX(id),0) AS max FROM %s', $groupName));
1428 1428
 		return empty($maxID['max']) || $maxID['max'] < $difference ? 0 : $maxID['max'] - $difference;
1429 1429
 	}
1430 1430
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -641,7 +641,7 @@
 block discarded – undo
641 641
 						$returnCount++;
642 642
 
643 643
 						if ($this->echoCLI) {
644
-							echo "Added $returnCount releases.\r";
644
+							echo "added $returnCount releases.\r";
645 645
 						}
646 646
 					}
647 647
 				} else {
Please login to merge, or discard this patch.
nntmux/processing/Videos.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 abstract class Videos
31 31
 {
32 32
 	// Video Type Identifiers
33
-	const TYPE_TV		= 0; // Type of video is a TV Programme/Show
33
+	const TYPE_TV = 0; // Type of video is a TV Programme/Show
34 34
 	const TYPE_FILM		= 1; // Type of video is a Film/Movie
35 35
 	const TYPE_ANIME	= 2; // Type of video is a Anime
36 36
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 	protected function getSiteIDFromVideoID($siteColumn, $videoID)
93 93
 	{
94 94
 		if (in_array($siteColumn, $this->sites)) {
95
-			$result = $this->pdo->queryOneRow("SELECT $siteColumn FROM videos WHERE id = $videoID");
95
+			$result = $this->pdo->queryOneRow("select $siteColumn FROM videos WHERE id = $videoID");
96 96
 
97 97
 			return isset($result[$siteColumn]) ? $result[$siteColumn] : false;
98 98
 		}
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	public function addAliases($videoId, array $aliases = [])
303 303
 	{
304 304
 		if (!empty($aliases) && $videoId > 0) {
305
-			foreach ($aliases AS $key => $title) {
305
+			foreach ($aliases as $key => $title) {
306 306
 				// Check for tvmaze style aka
307 307
 				if (is_array($title) && !empty($title['name'])) {
308 308
 					$title = $title['name'];
Please login to merge, or discard this patch.
nntmux/processing/post/AniDB.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -249,7 +249,7 @@
 block discarded – undo
249 249
 				$this->updateRelease($anidbId['anidbid'], $release['id']);
250 250
 
251 251
 				$this->pdo->log->doEcho(
252
-					$this->pdo->log->headerOver("Matched {$type} AniDB ID: ") .
252
+					$this->pdo->log->headerOver("matched {$type} AniDB ID: ") .
253 253
 					$this->pdo->log->primary($anidbId['anidbid']) .
254 254
 					$this->pdo->log->alternateOver("   Title: ") .
255 255
 					$this->pdo->log->primary($anidbId['title']) .
Please login to merge, or discard this patch.
nntmux/PreDb.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
  *
10 10
  * Class PreDb
11 11
  */
12
-Class PreDb
12
+class PreDb
13 13
 {
14 14
 	// Nuke status.
15 15
 	const PRE_NONUKE  = 0; // Pre is not nuked.
Please login to merge, or discard this patch.
nntmux/Desura.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	{
121 121
 			if ($this->_ret = $this->_html->find("img[alt=Boxshot]", 0)) {
122 122
 				$this->_ret->src = preg_replace('#cache/#', '', $this->_ret->src);
123
-				$this->_ret->src = preg_replace('#thumb_150x150/#','',$this->_ret->src);
123
+				$this->_ret->src = preg_replace('#thumb_150x150/#', '', $this->_ret->src);
124 124
 				$this->_res['cover'] = $this->_ret->src;
125 125
 			}
126 126
 
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
 			$this->searchTerm = preg_replace('#\s#', '-', strtolower($this->searchTerm));
197 197
 			if ($this->getUrl(self::DESURAURL . '/games/' . $this->searchTerm) !== false) {
198 198
 				if (!preg_match('#(Games system error)#i', $this->_response)) {
199
-					if($this->_ret = $this->_html->find("a#watchtoggle", 0)){
200
-						if(preg_match('#siteareaid=(?<gameid>\d+)#', $this->_ret->href, $matches)){
199
+					if ($this->_ret = $this->_html->find("a#watchtoggle", 0)) {
200
+						if (preg_match('#siteareaid=(?<gameid>\d+)#', $this->_ret->href, $matches)) {
201 201
 							$this->_desuraGameID = $matches['gameid'];
202 202
 							$this->_directURL = self::DESURAURL . '/games/' . $this->searchTerm;
203 203
 							$result = true;
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -196,8 +196,8 @@
 block discarded – undo
196 196
 			$this->searchTerm = preg_replace('#\s#', '-', strtolower($this->searchTerm));
197 197
 			if ($this->getUrl(self::DESURAURL . '/games/' . $this->searchTerm) !== false) {
198 198
 				if (!preg_match('#(Games system error)#i', $this->_response)) {
199
-					if($this->_ret = $this->_html->find("a#watchtoggle", 0)){
200
-						if(preg_match('#siteareaid=(?<gameid>\d+)#', $this->_ret->href, $matches)){
199
+					if($this->_ret = $this->_html->find("a#watchtoggle", 0)) {
200
+						if(preg_match('#siteareaid=(?<gameid>\d+)#', $this->_ret->href, $matches)) {
201 201
 							$this->_desuraGameID = $matches['gameid'];
202 202
 							$this->_directURL = self::DESURAURL . '/games/' . $this->searchTerm;
203 203
 							$result = true;
Please login to merge, or discard this patch.
nntmux/ConsoleTools.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@
 block discarded – undo
40 40
 	 */
41 41
 	public function overWriteHeader($message, $reset = False)
42 42
 	{
43
-		if ($reset)
44
-			$this->lastMessageLength = 0;
43
+		if ($reset) {
44
+					$this->lastMessageLength = 0;
45
+		}
45 46
 
46 47
 		echo str_repeat(chr(8), $this->lastMessageLength);
47 48
 		echo str_repeat(" ", $this->lastMessageLength);
Please login to merge, or discard this patch.