Passed
Pull Request — release-2.1 (#6344)
by Jon
05:54
created
Sources/Cache/APIs/MemcachedImplementation.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -181,15 +181,15 @@  discard block
 block discarded – undo
181 181
 		$class_name = $this->getImplementationClassKeyName();
182 182
 		$class_name_txt_key = strtolower($class_name);
183 183
 
184
-		$config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings'];
184
+		$config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings'];
185 185
 		$config_vars[] = array(
186 186
 			self::CLASS_KEY,
187
-			$txt['cache_'. $class_name_txt_key .'_servers'],
187
+			$txt['cache_' . $class_name_txt_key . '_servers'],
188 188
 			'file',
189 189
 			'text',
190 190
 			0,
191
-			'cache_'. $class_name_txt_key,
192
-			'subtext' => $txt['cache_'. $class_name_txt_key .'_servers_subtext']);
191
+			'cache_' . $class_name_txt_key,
192
+			'subtext' => $txt['cache_' . $class_name_txt_key . '_servers_subtext']);
193 193
 
194 194
 		if (!isset($context['settings_post_javascript']))
195 195
 			$context['settings_post_javascript'] = '';
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		$context['settings_post_javascript'] .= '
198 198
 			$("#cache_accelerator").change(function (e) {
199 199
 				var cache_type = e.currentTarget.value;
200
-				$("#'. self::CLASS_KEY .'").prop("disabled", cache_type != "'. $class_name .'");
200
+				$("#'. self::CLASS_KEY . '").prop("disabled", cache_type != "' . $class_name . '");
201 201
 			});';
202 202
 	}
203 203
 
Please login to merge, or discard this patch.
Sources/Cache/APIs/FileBased.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		$class_name = $this->getImplementationClassKeyName();
185 185
 		$class_name_txt_key = strtolower($class_name);
186 186
 
187
-		$config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings'];
187
+		$config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings'];
188 188
 		$config_vars[] = array('cachedir', $txt['cachedir'], 'file', 'text', 36, 'cache_cachedir');
189 189
 
190 190
 		if (!isset($context['settings_post_javascript']))
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 		$context['settings_post_javascript'] .= '
194 194
 			$("#cache_accelerator").change(function (e) {
195 195
 				var cache_type = e.currentTarget.value;
196
-				$("#cachedir").prop("disabled", cache_type != "'. $class_name .'");
196
+				$("#cachedir").prop("disabled", cache_type != "'. $class_name . '");
197 197
 			});';
198 198
 	}
199 199
 
Please login to merge, or discard this patch.
Sources/Cache/APIs/MemcacheImplementation.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -181,15 +181,15 @@  discard block
 block discarded – undo
181 181
 		$class_name = $this->getImplementationClassKeyName();
182 182
 		$class_name_txt_key = strtolower($class_name);
183 183
 
184
-		$config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings'];
184
+		$config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings'];
185 185
 		$config_vars[] = array(
186 186
 			self::CLASS_KEY,
187
-			$txt['cache_'. $class_name_txt_key .'_servers'],
187
+			$txt['cache_' . $class_name_txt_key . '_servers'],
188 188
 			'file',
189 189
 			'text',
190 190
 			0,
191
-			'cache_'. $class_name_txt_key,
192
-			'subtext' => $txt['cache_'. $class_name_txt_key .'_servers_subtext']);
191
+			'cache_' . $class_name_txt_key,
192
+			'subtext' => $txt['cache_' . $class_name_txt_key . '_servers_subtext']);
193 193
 
194 194
 		if (!isset($context['settings_post_javascript']))
195 195
 			$context['settings_post_javascript'] = '';
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 		$context['settings_post_javascript'] .= '
198 198
 			$("#cache_accelerator").change(function (e) {
199 199
 				var cache_type = e.currentTarget.value;
200
-				$("#'. self::CLASS_KEY .'").prop("disabled", cache_type != "'. $class_name .'");
200
+				$("#'. self::CLASS_KEY . '").prop("disabled", cache_type != "' . $class_name . '");
201 201
 			});';
202 202
 	}
203 203
 
Please login to merge, or discard this patch.
Sources/Cache/APIs/Sqlite.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
 		$class_name = $this->getImplementationClassKeyName();
132 132
 		$class_name_txt_key = strtolower($class_name);
133 133
 
134
-		$config_vars[] = $txt['cache_'. $class_name_txt_key .'_settings'];
134
+		$config_vars[] = $txt['cache_' . $class_name_txt_key . '_settings'];
135 135
 		$config_vars[] = array(
136
-			'cachedir_'. $class_name_txt_key,
137
-			$txt['cachedir_'. $class_name_txt_key],
136
+			'cachedir_' . $class_name_txt_key,
137
+			$txt['cachedir_' . $class_name_txt_key],
138 138
 			'file',
139 139
 			'text',
140 140
 			36,
141
-			'cache_'. $class_name_txt_key .'_cachedir');
141
+			'cache_' . $class_name_txt_key . '_cachedir');
142 142
 
143 143
 		if (!isset($context['settings_post_javascript']))
144 144
 			$context['settings_post_javascript'] = '';
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 		$context['settings_post_javascript'] .= '
147 147
 			$("#cache_accelerator").change(function (e) {
148 148
 				var cache_type = e.currentTarget.value;
149
-				$("#cachedir_'. $class_name_txt_key .'").prop("disabled", cache_type != "'. $class_name .'");
149
+				$("#cachedir_'. $class_name_txt_key . '").prop("disabled", cache_type != "' . $class_name . '");
150 150
 			});';
151 151
 	}
152 152
 
Please login to merge, or discard this patch.
Themes/default/Profile.template.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1721,7 +1721,7 @@  discard block
 block discarded – undo
1721 1721
 		{
1722 1722
 			// Avoid double separators and empty titled sections
1723 1723
 			$empty_section = true;
1724
-			for ($j=$i+1; $j < count($context['theme_options']); $j++)
1724
+			for ($j = $i + 1; $j < count($context['theme_options']); $j++)
1725 1725
 			{
1726 1726
 				// Found another separator, so we're done
1727 1727
 				if (!is_array($context['theme_options'][$j]))
@@ -2700,8 +2700,7 @@  discard block
 block discarded – undo
2700 2700
 		foreach ($context['post_errors'] as $error)
2701 2701
 		{
2702 2702
 			$text_key_error = $error == 'password_short' ?
2703
-				sprintf($txt['profile_error_' . $error], (empty($modSettings['password_strength']) ? 4 : 8)) :
2704
-				$txt['profile_error_' . $error];
2703
+				sprintf($txt['profile_error_' . $error], (empty($modSettings['password_strength']) ? 4 : 8)) : $txt['profile_error_' . $error];
2705 2704
 
2706 2705
 			echo '
2707 2706
 				<li>', isset($txt['profile_error_' . $error]) ? $text_key_error : $error, '</li>';
Please login to merge, or discard this patch.
Sources/Subs-Db-postgresql.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 		display_db_error();
76 76
 
77 77
 	// We need to escape ' and \
78
-	$db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd);
78
+	$db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd);
79 79
 
80 80
 	// Since pg_connect doesn't feed error info to pg_last_error, we have to catch issues with a try/catch.
81 81
 	set_error_handler(function($errno, $errstr) {
82
-		throw new ErrorException($errstr, $errno);});
82
+		throw new ErrorException($errstr, $errno); });
83 83
 	try
84 84
 	{
85 85
 		if (!empty($db_options['persist']))
@@ -938,7 +938,7 @@  discard block
 block discarded – undo
938 938
 	if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false)
939 939
 		$error_array[2] = null;
940 940
 
941
-	if(empty($db_persist))
941
+	if (empty($db_persist))
942 942
 	{ // without pooling
943 943
 		if (empty($pg_error_data_prep))
944 944
 			$pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors',
Please login to merge, or discard this patch.
Sources/Load.php 1 patch
Spacing   +6 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2717,8 +2717,7 @@  discard block
 block discarded – undo
2717 2717
 		$context['css_files_order'] = array();
2718 2718
 
2719 2719
 	$params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ?
2720
-		(array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') :
2721
-		(is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : '');
2720
+		(array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : '');
2722 2721
 	$params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false;
2723 2722
 	$themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme';
2724 2723
 	$params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true;
@@ -2832,8 +2831,7 @@  discard block
 block discarded – undo
2832 2831
 	global $settings, $context, $modSettings;
2833 2832
 
2834 2833
 	$params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ?
2835
-		(array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') :
2836
-		(is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : '');
2834
+		(array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : '');
2837 2835
 	$params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false;
2838 2836
 	$themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme';
2839 2837
 	$params['async'] = isset($params['async']) ? $params['async'] : false;
@@ -3573,10 +3571,10 @@  discard block
 block discarded – undo
3573 3571
 		$cacheAPI = false;
3574 3572
 
3575 3573
 	// Autoload hasn't been called yet :/
3576
-	require_once($cacheAPIdir .'/CacheApi.php');
3577
-	require_once($cacheAPIdir .'/CacheApiInterface.php');
3574
+	require_once($cacheAPIdir . '/CacheApi.php');
3575
+	require_once($cacheAPIdir . '/CacheApiInterface.php');
3578 3576
 
3579
-	$apis_dir = $cacheAPIdir .'/'. CacheApi::APIS_FOLDER;
3577
+	$apis_dir = $cacheAPIdir . '/' . CacheApi::APIS_FOLDER;
3580 3578
 
3581 3579
 	// What accelerator we are going to try.
3582 3580
 	$cache_class_name = !empty($cache_accelerator) ? $cache_accelerator : CacheApi::APIS_DEFAULT;
@@ -3588,8 +3586,7 @@  discard block
 block discarded – undo
3588 3586
 	{
3589 3587
 		require_once($file_to_load);
3590 3588
 
3591
-		$fully_qualified_class_name = !empty($overrideCache) ? $overrideCache :
3592
-			CacheApi::APIS_NAMESPACE . $cache_class_name;
3589
+		$fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : CacheApi::APIS_NAMESPACE . $cache_class_name;
3593 3590
 
3594 3591
 		/* @var CacheApiInterface $cache_api */
3595 3592
 		$cache_api = new $fully_qualified_class_name();
Please login to merge, or discard this patch.
Sources/ManageServer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1638,7 +1638,7 @@
 block discarded – undo
1638 1638
 	$cacheAPIdir = $sourcedir . '/Cache';
1639 1639
 
1640 1640
 	$loadedApis = array();
1641
-	$apis_dir = $cacheAPIdir .'/'. CacheApi::APIS_FOLDER;
1641
+	$apis_dir = $cacheAPIdir . '/' . CacheApi::APIS_FOLDER;
1642 1642
 
1643 1643
 	$api_classes = new GlobIterator($apis_dir . '/*.php', FilesystemIterator::NEW_CURRENT_AND_KEY);
1644 1644
 
Please login to merge, or discard this patch.
Sources/Subs-BoardIndex.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -195,8 +195,7 @@
 block discarded – undo
195 195
 				);
196 196
 
197 197
 				$categories[$row_board['id_cat']]['link'] = '<a id="c' . $row_board['id_cat'] . '"></a>' . (!$context['user']['is_guest'] ?
198
-						'<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' :
199
-						$row_board['cat_name']);
198
+						'<a href="' . $scripturl . '?action=unread;c=' . $row_board['id_cat'] . '" title="' . sprintf($txt['new_posts_in_category'], $row_board['cat_name']) . '">' . $row_board['cat_name'] . '</a>' : $row_board['cat_name']);
200 199
 
201 200
 			}
202 201
 
Please login to merge, or discard this patch.