Passed
Push — dev ( 9708e4...6d545c )
by Darko
09:51
created
www/admin/opcachestats.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -61,6 +61,9 @@
 block discarded – undo
61 61
 		return $self;
62 62
 	}
63 63
 
64
+	/**
65
+	 * @param string $name
66
+	 */
64 67
 	public function getOption($name = null)
65 68
 	{
66 69
 		if ($name === null) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,8 +110,7 @@
 block discarded – undo
110 110
 	{
111 111
 		$status = opcache_get_status();
112 112
 		$config = opcache_get_configuration();
113
-		$memsize = function($size, $precision = 3, $space = false)
114
-		{
113
+		$memsize = function($size, $precision = 3, $space = false) {
115 114
 			$i = 0;
116 115
 			$val = array(' bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
117 116
 			while (($size / 1024) > 1) {
Please login to merge, or discard this patch.
www/plugins/function.html_options_multiple.php 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -167,6 +167,10 @@
 block discarded – undo
167 167
 	}
168 168
 	return $_html_result;
169 169
 }
170
+/**
171
+ * @param string|null $id
172
+ * @param integer $idx
173
+ */
170 174
 function smarty_function_html_options_multiple_optgroup($key, $values, $selected, $id, $class, &$idx)
171 175
 {
172 176
 	$optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n";
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 			case 'name':
54 54
 			case 'class':
55 55
 			case 'id':
56
-				$$_key = (string) $_val;
56
+				$$_key = (string)$_val;
57 57
 				break;
58 58
 			case 'options':
59
-				$options = (array) $_val;
59
+				$options = (array)$_val;
60 60
 				break;
61 61
 			case 'values':
62 62
 			case 'output':
63
-				$$_key = array_values((array) $_val);
63
+				$$_key = array_values((array)$_val);
64 64
 				break;
65 65
 			case 'selected':
66 66
 				if (is_array($_val)) {
@@ -68,24 +68,24 @@  discard block
 block discarded – undo
68 68
 					foreach ($_val as $_sel) {
69 69
 						if (is_object($_sel)) {
70 70
 							if (method_exists($_sel, "__toString")) {
71
-								$_sel = smarty_function_escape_special_chars((string) $_sel->__toString());
71
+								$_sel = smarty_function_escape_special_chars((string)$_sel->__toString());
72 72
 							} else {
73
-								trigger_error("html_options_multiple: selected attribute contains an object of class '". get_class($_sel) ."' without __toString() method", E_USER_NOTICE);
73
+								trigger_error("html_options_multiple: selected attribute contains an object of class '" . get_class($_sel) . "' without __toString() method", E_USER_NOTICE);
74 74
 								continue;
75 75
 							}
76 76
 						} else {
77
-							$_sel = smarty_function_escape_special_chars((string) $_sel);
77
+							$_sel = smarty_function_escape_special_chars((string)$_sel);
78 78
 						}
79 79
 						$selected[$_sel] = true;
80 80
 					}
81 81
 				} elseif (is_object($_val)) {
82 82
 					if (method_exists($_val, "__toString")) {
83
-						$selected = smarty_function_escape_special_chars((string) $_val->__toString());
83
+						$selected = smarty_function_escape_special_chars((string)$_val->__toString());
84 84
 					} else {
85
-						trigger_error("html_options_multiple: selected attribute is an object of class '". get_class($_val) ."' without __toString() method", E_USER_NOTICE);
85
+						trigger_error("html_options_multiple: selected attribute is an object of class '" . get_class($_val) . "' without __toString() method", E_USER_NOTICE);
86 86
 					}
87 87
 				} else {
88
-					$selected = smarty_function_escape_special_chars((string) $_val);
88
+					$selected = smarty_function_escape_special_chars((string)$_val);
89 89
 				}
90 90
 				break;
91 91
 			case 'strict': break;
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
 		}
128 128
 	}
129 129
 	if (!empty($name)) {
130
-		$_html_class = !empty($class) ? ' class="'.$class.'"' : '';
131
-		$_html_id = !empty($id) ? ' id="'.$id.'"' : '';
130
+		$_html_class = !empty($class) ? ' class="' . $class . '"' : '';
131
+		$_html_id = !empty($id) ? ' id="' . $id . '"' : '';
132 132
 		// the name needs to have [] added (this is html text [] not PHP, so that the return for the multiselect is an array
133 133
 		$_html_result = '<select multiple="multiple" name="' . $name . '[]"' . $_html_class . $_html_id . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
134 134
 	}
@@ -146,23 +146,23 @@  discard block
 block discarded – undo
146 146
 		} elseif ($_key === $selected) {
147 147
 			$_html_result .= ' selected="selected"';
148 148
 		}
149
-		$_html_class = !empty($class) ? ' class="'.$class.' option"' : '';
150
-		$_html_id = !empty($id) ? ' id="'.$id.'-'.$idx.'"' : '';
149
+		$_html_class = !empty($class) ? ' class="' . $class . ' option"' : '';
150
+		$_html_id = !empty($id) ? ' id="' . $id . '-' . $idx . '"' : '';
151 151
 		if (is_object($value)) {
152 152
 			if (method_exists($value, "__toString")) {
153
-				$value = smarty_function_escape_special_chars((string) $value->__toString());
153
+				$value = smarty_function_escape_special_chars((string)$value->__toString());
154 154
 			} else {
155
-				trigger_error("html_options_multiple: value is an object of class '". get_class($value) ."' without __toString() method", E_USER_NOTICE);
155
+				trigger_error("html_options_multiple: value is an object of class '" . get_class($value) . "' without __toString() method", E_USER_NOTICE);
156 156
 				return '';
157 157
 			}
158 158
 		} else {
159
-			$value = smarty_function_escape_special_chars((string) $value);
159
+			$value = smarty_function_escape_special_chars((string)$value);
160 160
 		}
161 161
 		$_html_result .= $_html_class . $_html_id . '>' . $value . '</option>' . "\n";
162 162
 		$idx++;
163 163
 	} else {
164 164
 		$_idx = 0;
165
-		$_html_result = smarty_function_html_options_multiple_optgroup($key, $value, $selected, !empty($id) ? ($id.'-'.$idx) : null, $class, $_idx);
165
+		$_html_result = smarty_function_html_options_multiple_optgroup($key, $value, $selected, !empty($id) ? ($id . '-' . $idx) : null, $class, $_idx);
166 166
 		$idx++;
167 167
 	}
168 168
 	return $_html_result;
Please login to merge, or discard this patch.
nntmux/Categorize.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1026,8 +1026,8 @@
 block discarded – undo
1026 1026
 
1027 1027
 	public function isXxxClipSD()
1028 1028
 	{
1029
-		switch(true) {
1030
-			case $this->checkPoster( '/oz@lot[.]com/i', $this->poster, Category::XXX_CLIPSD):
1029
+		switch (true) {
1030
+			case $this->checkPoster('/oz@lot[.]com/i', $this->poster, Category::XXX_CLIPSD):
1031 1031
 				return true;
1032 1032
 			case preg_match('/SDPORN/i', $this->releaseName):
1033 1033
 				$this->tmpCat = Category::XXX_CLIPSD;
Please login to merge, or discard this patch.
nntmux/NZBImport.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,8 +106,8 @@
 block discarded – undo
106 106
 	public function __construct(array $options = [])
107 107
 	{
108 108
 		$defaults = [
109
-			'Browser'         => false,	// Was this started from the browser?
110
-			'Echo'            => true,	// Echo to CLI?
109
+			'Browser'         => false, // Was this started from the browser?
110
+			'Echo'            => true, // Echo to CLI?
111 111
 			'Binaries'        => null,
112 112
 			'Categorize'      => null,
113 113
 			'NZB'             => null,
Please login to merge, or discard this patch.
nntmux/Captcha.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 	/**
61 61
 	 * Settings key literals
62 62
 	 */
63
-	const RECAPTCHA_SETTING_SITEKEY		= 'recaptchapublickey';
64
-	const RECAPTCHA_SETTING_SECRETKEY 	= 'recaptchaprivatekey';
63
+	const RECAPTCHA_SETTING_SITEKEY = 'recaptchapublickey';
64
+	const RECAPTCHA_SETTING_SECRETKEY = 'recaptchaprivatekey';
65 65
 
66 66
 	/**
67 67
 	 * Construct and decide whether to show the captcha or not.
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 		$rc_error = 'ReCaptcha Failed: ';
151 151
 
152 152
 		foreach ($codes as $c) {
153
-			switch($c) {
153
+			switch ($c) {
154 154
 				case self::RECAPTCHA_ERROR_MISSING_SECRET:
155 155
 					$rc_error .= 'Missing Secret Key';
156 156
 					break;
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,7 +3,8 @@  discard block
 block discarded – undo
3 3
 
4 4
 use ReCaptcha\ReCaptcha;
5 5
 
6
-class Captcha {
6
+class Captcha
7
+{
7 8
 	/**
8 9
 	 * Smarty $page
9 10
 	 *
@@ -69,7 +70,8 @@  discard block
 block discarded – undo
69 70
 	 * @note Passing $page by reference to setup smarty vars easily.
70 71
 	 * @param \Page $page
71 72
 	 */
72
-	public function __construct(&$page) {
73
+	public function __construct(&$page)
74
+	{
73 75
 		if (!$page instanceof \Page) {
74 76
 			throw new \InvalidArgumentException('Invalid Page variable provided');
75 77
 		}
@@ -99,7 +101,8 @@  discard block
 block discarded – undo
99 101
 	 *
100 102
 	 * @return bool
101 103
 	 */
102
-	public function shouldDisplay() {
104
+	public function shouldDisplay()
105
+	{
103 106
 		if ($this->_bootstrapCaptcha()) {
104 107
 			return true;
105 108
 		}
@@ -112,7 +115,8 @@  discard block
 block discarded – undo
112 115
 	 *
113 116
 	 * @return string
114 117
 	 */
115
-	public function getError() {
118
+	public function getError()
119
+	{
116 120
 		return $this->error;
117 121
 	}
118 122
 
@@ -123,7 +127,8 @@  discard block
 block discarded – undo
123 127
 	 * @param string $ip
124 128
 	 * @return bool
125 129
 	 */
126
-	public function processCaptcha($response, $ip) {
130
+	public function processCaptcha($response, $ip)
131
+	{
127 132
 		if (isset($response[self::RECAPTCHA_POSTKEY])) {
128 133
 			$post_response = $response[self::RECAPTCHA_POSTKEY];
129 134
 		} else {
@@ -146,7 +151,8 @@  discard block
 block discarded – undo
146 151
 	 *
147 152
 	 * @param array $codes
148 153
 	 */
149
-	private function _handleErrors($codes) {
154
+	private function _handleErrors($codes)
155
+	{
150 156
 		$rc_error = 'ReCaptcha Failed: ';
151 157
 
152 158
 		foreach ($codes as $c) {
@@ -177,7 +183,8 @@  discard block
 block discarded – undo
177 183
 	 *
178 184
 	 * @return bool
179 185
 	 */
180
-	private function _bootstrapCaptcha() {
186
+	private function _bootstrapCaptcha()
187
+	{
181 188
 		if ($this->recaptcha instanceof ReCaptcha) {
182 189
 			return true;
183 190
 		}
Please login to merge, or discard this patch.
nntmux/Binaries.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1213,7 +1213,7 @@
 block discarded – undo
1213 1213
 		$aMin = $data['first'];
1214 1214
 		$reallyOldArticle = $oldArticle = $articleTime = null;
1215 1215
 
1216
-		while(true) {
1216
+		while (true) {
1217 1217
 			// Article exists outside of available range, this shouldn't happen
1218 1218
 			if ($wantedArticle <= $data['first'] || $wantedArticle >= $data['last']) {
1219 1219
 				break;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -562,7 +562,7 @@
 block discarded – undo
562 562
 			if ($this->_nntp->isError($headers)) {
563 563
 				$message = ($headers->code == 0 ? 'Unknown error' : $headers->message);
564 564
 				$this->log(
565
-					"Code {$headers->code}: $message\nSkipping group: {$groupMySQL['name']}",
565
+					"code {$headers->code}: $message\nSkipping group: {$groupMySQL['name']}",
566 566
 					__FUNCTION__,
567 567
 					Logger::LOG_WARNING,
568 568
 					'error'
Please login to merge, or discard this patch.
nntmux/MiscSorter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -693,7 +693,7 @@
 block discarded – undo
693 693
 			&& !preg_match('/(\bavi\b|x\.?264|divx|mvk|xvid|install(?!ation)|Setup\.exe|unzip|unrar)/i', $nfo)
694 694
 		) {
695 695
 			$artist = preg_split('/(?:a\s?r\s?t\s?i\s?s\s?t\s?s?\b[^ \.\:]*|a\s?u\s?t\s?h\s?o\s?r\s?s?\b[^ \.\:]*) *?(?!(?:[^\s\.\:\}\]\*\x{2500}-\x{3000}\?] ?){2,}?\b)(?:[\*\?\-\=\|\;\:\.\[\}\]\(\s\x{2500}-\x{3000}\?]+?)[\s\.\>\:\(\)\x{2500}-\x{3000}\?]((?!\:) ?\w.+)(?:\n|$|\s{3}|\.{3})/Uuim', $nfo, 0, PREG_SPLIT_DELIM_CAPTURE);
696
-			if(isset($artist[1])) {
696
+			if (isset($artist[1])) {
697 697
 				$title = preg_split('/(?:t+\s?i+\s?t+\s?l+\s?e+\b|a\s?l\s?b\s?u\s?m\b|r\s?e\s?l\s?e\s?a\s?s\s?e\b) *?(?!(?:[^\s\.\:\}\]\*\x{2500}-\x{3000}\?] ?){2,}?\b)(?:[\*\?\-\=\|\;\:\.\[\}\]\(\s\x{2500}-\x{3000}\?]+?)[\s\.\>\:\(\)\x{2500}-\x{3000}\?]((?!\:) ?\w.+)(?:\n|$|\s{3}|\.{3})/Uuim', $nfo, 0, PREG_SPLIT_DELIM_CAPTURE);
698 698
 			}
699 699
 
Please login to merge, or discard this patch.
nntmux/Steam.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 			$totaldetails = count($textarr) - 1;
137 137
 			for ($i = 0; $i <= $totaldetails;) {
138 138
 				if ($textarr[$i] == "Release Date") {
139
-					$pregmatchdate = $textarr[$i+1];
139
+					$pregmatchdate = $textarr[$i + 1];
140 140
 					if (preg_match_all('#(?P<day>[0-3]?\d)[^\d]|(?P<month>Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)|(?P<year>(19|20)\d{2})#i',
141 141
 						$pregmatchdate,
142 142
 						$matches)) {
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
 						}
152 152
 					}
153 153
 				}
154
-				$this->_res['gamedetails'][$textarr[$i]] = $textarr[$i+1];
155
-				$i = $i+2;
154
+				$this->_res['gamedetails'][$textarr[$i]] = $textarr[$i + 1];
155
+				$i = $i + 2;
156 156
 			}
157 157
 		}
158 158
 
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
 		}
218 218
 		if ($this->_ret = $this->_html->find("div.screenshot_holder", 0)) {
219 219
 			if ($this->_ret = $this->_ret->find("a", 0)) {
220
-				if(preg_match('/\?url\=(?<imgurl>.*)/', $this->_ret->href, $matches)){
220
+				if (preg_match('/\?url\=(?<imgurl>.*)/', $this->_ret->href, $matches)) {
221 221
 					$this->_res['backdrop'] = trim($matches['imgurl']);
222
-				}else{
222
+				} else {
223 223
 					$this->_res['backdrop'] = trim($this->_ret->href);
224 224
 				}
225 225
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	{
331 331
 		if (isset($this->cookie)) {
332 332
 			$this->extractCookies(file_get_contents($this->cookie));
333
-			if($this->_ageCheckSet === false) {
333
+			if ($this->_ageCheckSet === false) {
334 334
 				$this->_postParams = array(
335 335
 					"snr" => "1_agecheck_agecheck__age-gate",
336 336
 					"ageDay" => "1",
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -217,9 +217,9 @@
 block discarded – undo
217 217
 		}
218 218
 		if ($this->_ret = $this->_html->find("div.screenshot_holder", 0)) {
219 219
 			if ($this->_ret = $this->_ret->find("a", 0)) {
220
-				if(preg_match('/\?url\=(?<imgurl>.*)/', $this->_ret->href, $matches)){
220
+				if(preg_match('/\?url\=(?<imgurl>.*)/', $this->_ret->href, $matches)) {
221 221
 					$this->_res['backdrop'] = trim($matches['imgurl']);
222
-				}else{
222
+				} else {
223 223
 					$this->_res['backdrop'] = trim($this->_ret->href);
224 224
 				}
225 225
 
Please login to merge, or discard this patch.
nntmux/libraries/TraktAPI.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 	 */
57 57
 	public function episodeSummary($id, $season = '', $ep = '', $type = 'min')
58 58
 	{
59
-		switch($type) {
59
+		switch ($type) {
60 60
 			case 'aliases':
61 61
 			case 'full':
62 62
 			case 'images':
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,8 @@
 block discarded – undo
7 7
  * Class TraktAPI
8 8
  * Retrive info from the Trakt API.
9 9
  */
10
-Class TraktAPI {
10
+Class TraktAPI
11
+{
11 12
 
12 13
 	const API_URL = 'https://api-v2launch.trakt.tv/';
13 14
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  * Class TraktAPI
8 8
  * Retrive info from the Trakt API.
9 9
  */
10
-Class TraktAPI {
10
+class TraktAPI {
11 11
 
12 12
 	const API_URL = 'https://api-v2launch.trakt.tv/';
13 13
 
Please login to merge, or discard this patch.