Passed
Pull Request — release-2.1 (#5093)
by 01
05:42
created
Sources/DbSearch-postgresql.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 	$version = $smcFunc['db_get_version']();
39 39
 	// if we got a Beta Version
40 40
 	if (stripos($version, 'beta') !== false)
41
-		$version = substr($version, 0, stripos($version, 'beta')).'.0';
41
+		$version = substr($version, 0, stripos($version, 'beta')) . '.0';
42 42
 	// or RC
43 43
 	if (stripos($version, 'rc') !== false)
44
-		$version = substr($version, 0, stripos($version, 'rc')).'.0';
44
+		$version = substr($version, 0, stripos($version, 'rc')) . '.0';
45 45
 
46
-	if (version_compare($version,'9.5.0','>='))
46
+	if (version_compare($version, '9.5.0', '>='))
47 47
 		$smcFunc['db_support_ignore'] = true;
48 48
 }
49 49
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
  */
56 56
 function smf_db_search_support($search_type)
57 57
 {
58
-	$supported_types = array('custom','fulltext');
58
+	$supported_types = array('custom', 'fulltext');
59 59
 
60 60
 	return in_array($search_type, $supported_types);
61 61
 }
@@ -109,9 +109,9 @@  discard block
 block discarded – undo
109 109
 	if (preg_match('~^\s*INSERT\sIGNORE~i', $db_string) != 0)
110 110
 	{
111 111
 		$db_string = preg_replace('~^\s*INSERT\sIGNORE~i', 'INSERT', $db_string);
112
-		if ($smcFunc['db_support_ignore']){
112
+		if ($smcFunc['db_support_ignore']) {
113 113
 			//pg style "INSERT INTO.... ON CONFLICT DO NOTHING"
114
-			$db_string = $db_string.' ON CONFLICT DO NOTHING';
114
+			$db_string = $db_string . ' ON CONFLICT DO NOTHING';
115 115
 		}
116 116
 		else
117 117
 		{
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 		$language_ftx = $modSettings['search_language'];
169 169
 	else
170 170
 	{
171
-		$request = $smcFunc['db_query']('','
171
+		$request = $smcFunc['db_query']('', '
172 172
 			SELECT cfgname FROM pg_ts_config WHERE oid = current_setting({string:default_language})::regconfig',
173 173
 			array(
174 174
 			'default_language' => 'default_text_search_config'
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,8 @@
 block discarded – undo
99 99
 	if (preg_match('~^\s*INSERT\sIGNORE~i', $db_string) != 0)
100 100
 	{
101 101
 		$db_string = preg_replace('~^\s*INSERT\sIGNORE~i', 'INSERT', $db_string);
102
-		if ($smcFunc['db_support_ignore']){
102
+		if ($smcFunc['db_support_ignore'])
103
+		{
103 104
 			//pg style "INSERT INTO.... ON CONFLICT DO NOTHING"
104 105
 			$db_string = $db_string.' ON CONFLICT DO NOTHING';
105 106
 		}
Please login to merge, or discard this patch.
Sources/tasks/Birthday-Notify.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
  */
19 19
 class Birthday_Notify_Background extends SMF_BackgroundTask
20 20
 {
21
-    /**
22
-     * This executes the task. It loads up the birthdays, figures out the greeting, etc.
23
-     * @return bool Always returns true
24
-     */
21
+	/**
22
+	 * This executes the task. It loads up the birthdays, figures out the greeting, etc.
23
+	 * @return bool Always returns true
24
+	 */
25 25
 	public function execute()
26 26
  	{
27 27
 		global $txt, $smcFunc, $txtBirthdayEmails, $modSettings, $sourcedir;
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      * @return bool Always returns true
24 24
      */
25 25
 	public function execute()
26
- 	{
26
+	{
27 27
 		global $txt, $smcFunc, $txtBirthdayEmails, $modSettings, $sourcedir;
28 28
 
29 29
 		$greeting = isset($modSettings['birthday_email']) ? $modSettings['birthday_email'] : 'happy_birthday';
Please login to merge, or discard this patch.
Sources/ManageCalendar.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 					'value' => $txt['date'],
137 137
 				),
138 138
 				'data' => array(
139
-					'function' => function ($rowData) use ($txt)
139
+					'function' => function($rowData) use ($txt)
140 140
 					{
141 141
 						// Recurring every year or just a single year?
142 142
 						$year = $rowData['year'] == '1004' ? sprintf('(%1$s)', $txt['every_year']) : $rowData['year'];
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 		checkSession();
219 219
 
220 220
 		// Not too long good sir?
221
-		$_REQUEST['title'] =  $smcFunc['substr']($_REQUEST['title'], 0, 60);
221
+		$_REQUEST['title'] = $smcFunc['substr']($_REQUEST['title'], 0, 60);
222 222
 		$_REQUEST['holiday'] = isset($_REQUEST['holiday']) ? (int) $_REQUEST['holiday'] : 0;
223 223
 
224 224
 		if (isset($_REQUEST['delete']))
Please login to merge, or discard this patch.
Sources/tasks/EventNew-Notify.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 class EventNew_Notify_Background extends SMF_BackgroundTask
21 21
 {
22 22
 	/**
23
-     * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed.
23
+	 * This executes the task - loads up the information, puts the email in the queue and inserts alerts as needed.
24 24
 	 * @return bool Always returns true
25 25
 	 */
26 26
 	public function execute()
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 					'content_action' => empty($this->_details['sender_id']) ? 'new_guest' : 'new',
82 82
 					'is_read' => 0,
83 83
 					'extra' => $smcFunc['json_encode'](
84
-					    array(
85
-					        "event_id" => $this->_details['event_id'],
84
+						array(
85
+							"event_id" => $this->_details['event_id'],
86 86
 							"event_title" => $this->_details['event_title']
87 87
 						)
88 88
 					),
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 	 * @return bool Always returns true
25 25
 	 */
26 26
 	public function execute()
27
- 	{
27
+	{
28 28
  		global $sourcedir, $smcFunc, $user_profile;
29 29
 
30 30
 		// Get everyone who could be notified - those are the people who can see the calendar.
Please login to merge, or discard this patch.
Sources/ManageSettings.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1334,7 +1334,7 @@  discard block
 block discarded – undo
1334 1334
 					'class' => 'centercol',
1335 1335
 				),
1336 1336
 				'data' => array(
1337
-					'function' => function ($rowData)
1337
+					'function' => function($rowData)
1338 1338
 					{
1339 1339
 						$isChecked = $rowData['disabled'] ? '' : ' checked';
1340 1340
 						$onClickHandler = $rowData['can_show_register'] ? sprintf(' onclick="document.getElementById(\'reg_%1$s\').disabled = !this.checked;"', $rowData['id']) : '';
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 					'class' => 'centercol',
1351 1351
 				),
1352 1352
 				'data' => array(
1353
-					'function' => function ($rowData)
1353
+					'function' => function($rowData)
1354 1354
 					{
1355 1355
 						$isChecked = $rowData['on_register'] && !$rowData['disabled'] ? ' checked' : '';
1356 1356
 						$isDisabled = $rowData['can_show_register'] ? '' : ' disabled';
@@ -1397,15 +1397,15 @@  discard block
 block discarded – undo
1397 1397
 					'value' => $txt['custom_profile_fieldorder'],
1398 1398
 				),
1399 1399
 				'data' => array(
1400
-					'function' => function ($rowData) use ($context, $txt, $scripturl)
1400
+					'function' => function($rowData) use ($context, $txt, $scripturl)
1401 1401
 					{
1402
-						$return = '<p class="centertext bold_text">'. $rowData['field_order'] .'<br>';
1402
+						$return = '<p class="centertext bold_text">' . $rowData['field_order'] . '<br>';
1403 1403
 
1404 1404
 						if ($rowData['field_order'] > 1)
1405
-							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=up"><span class="toggle_up" title="'. $txt['custom_edit_order_move'] .' '. $txt['custom_edit_order_up'] .'"></span></a>';
1405
+							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=up"><span class="toggle_up" title="' . $txt['custom_edit_order_move'] . ' ' . $txt['custom_edit_order_up'] . '"></span></a>';
1406 1406
 
1407 1407
 						if ($rowData['field_order'] < $context['custFieldsMaxOrder'])
1408
-							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=down"><span class="toggle_down" title="'. $txt['custom_edit_order_move'] .' '. $txt['custom_edit_order_down'] .'"></span></a>';
1408
+							$return .= '<a href="' . $scripturl . '?action=admin;area=featuresettings;sa=profileedit;fid=' . $rowData['id_field'] . ';move=down"><span class="toggle_down" title="' . $txt['custom_edit_order_move'] . ' ' . $txt['custom_edit_order_down'] . '"></span></a>';
1409 1409
 
1410 1410
 						$return .= '</p>';
1411 1411
 
@@ -1423,7 +1423,7 @@  discard block
 block discarded – undo
1423 1423
 					'value' => $txt['custom_profile_fieldname'],
1424 1424
 				),
1425 1425
 				'data' => array(
1426
-					'function' => function ($rowData) use ($scripturl)
1426
+					'function' => function($rowData) use ($scripturl)
1427 1427
 					{
1428 1428
 						return sprintf('<a href="%1$s?action=admin;area=featuresettings;sa=profileedit;fid=%2$d">%3$s</a><div class="smalltext">%4$s</div>', $scripturl, $rowData['id_field'], $rowData['field_name'], $rowData['field_desc']);
1429 1429
 					},
@@ -1439,7 +1439,7 @@  discard block
 block discarded – undo
1439 1439
 					'value' => $txt['custom_profile_fieldtype'],
1440 1440
 				),
1441 1441
 				'data' => array(
1442
-					'function' => function ($rowData) use ($txt)
1442
+					'function' => function($rowData) use ($txt)
1443 1443
 					{
1444 1444
 						$textKey = sprintf('custom_profile_type_%1$s', $rowData['field_type']);
1445 1445
 						return isset($txt[$textKey]) ? $txt[$textKey] : $textKey;
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
 					'value' => $txt['custom_profile_active'],
1458 1458
 				),
1459 1459
 				'data' => array(
1460
-					'function' => function ($rowData) use ($txt)
1460
+					'function' => function($rowData) use ($txt)
1461 1461
 					{
1462 1462
 						return $rowData['active'] ? $txt['yes'] : $txt['no'];
1463 1463
 					},
@@ -1474,7 +1474,7 @@  discard block
 block discarded – undo
1474 1474
 					'value' => $txt['custom_profile_placement'],
1475 1475
 				),
1476 1476
 				'data' => array(
1477
-					'function' => function ($rowData)
1477
+					'function' => function($rowData)
1478 1478
 					{
1479 1479
 						global $txt, $context;
1480 1480
 
@@ -1709,7 +1709,7 @@  discard block
 block discarded – undo
1709 1709
 			redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler
1710 1710
 
1711 1711
 		// All good, proceed.
1712
-		$smcFunc['db_query']('','
1712
+		$smcFunc['db_query']('', '
1713 1713
 			UPDATE {db_prefix}custom_fields
1714 1714
 			SET field_order = {int:old_order}
1715 1715
 			WHERE field_order = {int:new_order}',
@@ -1718,7 +1718,7 @@  discard block
 block discarded – undo
1718 1718
 				'old_order' => $context['field']['order'],
1719 1719
 			)
1720 1720
 		);
1721
-		$smcFunc['db_query']('','
1721
+		$smcFunc['db_query']('', '
1722 1722
 			UPDATE {db_prefix}custom_fields
1723 1723
 			SET field_order = {int:new_order}
1724 1724
 			WHERE id_field = {int:id_field}',
@@ -1820,7 +1820,7 @@  discard block
 block discarded – undo
1820 1820
 			$smcFunc['db_free_result']($request);
1821 1821
 
1822 1822
 			$unique = false;
1823
-			for ($i = 0; !$unique && $i < 9; $i ++)
1823
+			for ($i = 0; !$unique && $i < 9; $i++)
1824 1824
 			{
1825 1825
 				if (!in_array($col_name, $current_fields))
1826 1826
 					$unique = true;
@@ -1993,7 +1993,7 @@  discard block
 block discarded – undo
1993 1993
 		);
1994 1994
 
1995 1995
 		// Re-arrange the order.
1996
-		$smcFunc['db_query']('','
1996
+		$smcFunc['db_query']('', '
1997 1997
 			UPDATE {db_prefix}custom_fields
1998 1998
 			SET field_order = field_order - 1
1999 1999
 			WHERE field_order > {int:current_order}',
@@ -2257,7 +2257,7 @@  discard block
 block discarded – undo
2257 2257
 	$context['token_check'] = 'noti-admin';
2258 2258
 
2259 2259
 	// Specify our action since we'll want to post back here instead of the profile
2260
-	$context['action'] = 'action=admin;area=featuresettings;sa=alerts;'. $context['session_var'] .'='. $context['session_id'];
2260
+	$context['action'] = 'action=admin;area=featuresettings;sa=alerts;' . $context['session_var'] . '=' . $context['session_id'];
2261 2261
 
2262 2262
 	loadTemplate('Profile');
2263 2263
 	loadLanguage('Profile');
Please login to merge, or discard this patch.
Sources/Modlog.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 					'class' => 'centercol',
257 257
 				),
258 258
 				'data' => array(
259
-					'function' => function ($entry)
259
+					'function' => function($entry)
260 260
 					{
261 261
 						return '<input type="checkbox" name="delete[]" value="' . $entry['id'] . '"' . ($entry['editable'] ? '' : ' disabled') . '>';
262 262
 					},
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
 		if (empty($entries[$k]['action_text']))
639 639
 			$entries[$k]['action_text'] = isset($txt['modlog_ac_' . $entry['action']]) ? $txt['modlog_ac_' . $entry['action']] : $entry['action'];
640 640
 		$entries[$k]['action_text'] = preg_replace_callback('~\{([A-Za-z\d_]+)\}~i',
641
-			function ($matches) use ($entries, $k)
641
+			function($matches) use ($entries, $k)
642 642
 			{
643 643
 				return isset($entries[$k]['extra'][$matches[1]]) ? $entries[$k]['extra'][$matches[1]] : '';
644 644
 			}, $entries[$k]['action_text']);
Please login to merge, or discard this patch.
Sources/DbExtra-postgresql.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
 	$table = str_replace('{db_prefix}', $db_prefix, $table);
93 93
 
94
-	$pg_tables = array('pg_catalog','information_schema');
94
+	$pg_tables = array('pg_catalog', 'information_schema');
95 95
 
96 96
 	$request = $smcFunc['db_query']('', '
97 97
 		SELECT pg_relation_size(C.oid) AS "size"
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	global $db_connection;
291 291
 	static $ver;
292 292
 
293
-	if(!empty($ver))
293
+	if (!empty($ver))
294 294
 		return $ver;
295 295
 
296 296
 	$ver = pg_version($db_connection)['server'];
Please login to merge, or discard this patch.
Sources/DbPackages-postgresql.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 			$smcFunc['db_drop_table']($table_name);
123 123
 		else if ($if_exists == 'update')
124 124
 		{
125
-			$smcFunc['db_drop_table']($table_name.'_old');
125
+			$smcFunc['db_drop_table']($table_name . '_old');
126 126
 			$smcFunc['db_transaction']('begin');
127 127
 			$db_trans = true;
128
-			$smcFunc['db_query']('','
129
-				ALTER TABLE '. $table_name .' RENAME TO ' . $table_name . '_old',
128
+			$smcFunc['db_query']('', '
129
+				ALTER TABLE '. $table_name . ' RENAME TO ' . $table_name . '_old',
130 130
 				array(
131 131
 					'security_override' => true,
132 132
 				)
@@ -213,15 +213,15 @@  discard block
 block discarded – undo
213 213
 	{
214 214
 		$same_col = array();
215 215
 
216
-		$request = $smcFunc['db_query']('','
216
+		$request = $smcFunc['db_query']('', '
217 217
 			SELECT count(*), column_name
218 218
 			FROM information_schema.columns
219 219
 			WHERE table_name in ({string:table1},{string:table2}) AND table_schema = {string:schema}
220 220
 			GROUP BY column_name
221 221
 			HAVING count(*) > 1',
222
-			array (
222
+			array(
223 223
 				'table1' => $table_name,
224
-				'table2' => $table_name.'_old',
224
+				'table2' => $table_name . '_old',
225 225
 				'schema' => 'public',
226 226
 			)
227 227
 		);
@@ -231,8 +231,8 @@  discard block
 block discarded – undo
231 231
 			$same_col[] = $row['column_name'];
232 232
 		}
233 233
 
234
-		$smcFunc['db_query']('','
235
-			INSERT INTO ' . $table_name .'('
234
+		$smcFunc['db_query']('', '
235
+			INSERT INTO ' . $table_name . '('
236 236
 			. implode($same_col, ',') .
237 237
 			')
238 238
 			SELECT '. implode($same_col, ',') . '
Please login to merge, or discard this patch.
Themes/default/index.template.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@
 block discarded – undo
232 232
 			// In maintenance mode, only login is allowed and don't show OverlayDiv
233 233
 			echo '
234 234
 			<ul class="floatleft welcome">
235
-				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl. '?action=login', 'return true;'), '</li>
235
+				<li>', sprintf($txt['welcome_guest'], $txt['guest_title'], '', $scripturl . '?action=login', 'return true;'), '</li>
236 236
 			</ul>';
237 237
 
238 238
 	if (!empty($modSettings['userLanguage']) && !empty($context['languages']) && count($context['languages']) > 1)
Please login to merge, or discard this patch.