Passed
Push — dev ( 273395...f26621 )
by Darko
08:55
created
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/processing/tv/TMDB.php 4 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @param      $process
54 54
 	 * @param bool $local
55 55
 	 */
56
-	public function processSite ($groupID, $guidChar, $process, $local = false)
56
+	public function processSite($groupID, $guidChar, $process, $local = false)
57 57
 	{
58 58
 		$res = $this->getTvReleases($groupID, $guidChar, $process, parent::PROCESS_TMDB);
59 59
 
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 						$this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']);
183 183
 						$this->titleCache[] = $release['cleanname'];
184 184
 					}
185
-				} else{
185
+				} else {
186 186
 					//Processing failed, set the episode ID to the next processing group
187 187
 					$this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']);
188 188
 					$this->titleCache[] = $release['cleanname'];
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@
 block discarded – undo
182 182
 						$this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']);
183 183
 						$this->titleCache[] = $release['cleanname'];
184 184
 					}
185
-				} else{
185
+				} else {
186 186
 					//Processing failed, set the episode ID to the next processing group
187 187
 					$this->setVideoNotFound(parent::PROCESS_TRAKT, $row['id']);
188 188
 					$this->titleCache[] = $release['cleanname'];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 		$return = false;
225 225
 		$highestMatch = 0;
226 226
 
227
-		foreach ($shows AS $show) {
227
+		foreach ($shows as $show) {
228 228
 			if ($this->checkRequiredAttr($show->_data, 'tmdbS')) {
229 229
 				// Check for exact title match first and then terminate if found
230 230
 				if (strtolower($show->_data['name']) === strtolower($cleanName)) {
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 		if (isset($highest)) {
246 246
 			$showAppends = $this->client->getTVShow($highest->_data['id'], 'append_to_response=alternative_titles,external_ids');
247 247
 			if (isset($showAppends->_data['alternative_titles']['results']) && is_array($showAppends->_data['alternative_titles']['results'])) {
248
-				foreach ($showAppends->_data['alternative_titles']['results'] AS $aka) {
248
+				foreach ($showAppends->_data['alternative_titles']['results'] as $aka) {
249 249
 					$highest->_data['alternative_titles'][] = $aka['title'];
250 250
 				}
251 251
 				$highest->_data['network'] = (isset($showAppends->_data['networks'][0]['name']) ? $showAppends->_data['networks'][0]['name'] : '');
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	 * Main processing director function for scrapers
56 56
 	 * Calls work query function and initiates processing
57 57
 	 *
58
-	 * @param      $groupID
59
-	 * @param      $guidChar
58
+	 * @param      string $groupID
59
+	 * @param      string $guidChar
60 60
 	 * @param      $process
61 61
 	 * @param bool $local
62 62
 	 */
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
 	/**
266 266
 	 * @param $shows
267
-	 * @param $cleanName
267
+	 * @param string $cleanName
268 268
 	 *
269 269
 	 * @return array|bool
270 270
 	 */
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.