Completed
Pull Request — development (#3620)
by Emanuele
07:38 queued 07:38
created
sources/subs/Mentions.subs.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  * @package Mentions
26 26
  *
27 27
  */
28
-function countUserMentions($all = false, $type = '', $id_member = null)
28
+function countUserMentions ($all = false, $type = '', $id_member = null)
29 29
 {
30 30
 	static $counts;
31 31
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
  * @package Mentions
81 81
  *
82 82
  */
83
-function getUserMentions($start, $limit, $sort, $all = false, $type = '')
83
+function getUserMentions ($start, $limit, $sort, $all = false, $type = '')
84 84
 {
85 85
 	global $txt;
86 86
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 			'sort' => $sort,
115 115
 		)
116 116
 	)->fetch_callback(
117
-		function ($row) {
117
+		function($row) {
118 118
 			$row['avatar'] = determineAvatar($row);
119 119
 
120 120
 			return $row;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
  * @package Mentions
134 134
  *
135 135
  */
136
-function removeMentions($id_mentions)
136
+function removeMentions ($id_mentions)
137 137
 {
138 138
 	$db = database();
139 139
 
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
  * @param bool $approved direction of the toggle read / unread
165 165
  * @package Mentions
166 166
  */
167
-function toggleMentionsApproval($msgs, $approved)
167
+function toggleMentionsApproval ($msgs, $approved)
168 168
 {
169 169
 	$db = database();
170 170
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 			'messages' => $msgs,
190 190
 		)
191 191
 	)->fetch_callback(
192
-		function ($row) use ($status) {
192
+		function($row) use ($status) {
193 193
 			updateMentionMenuCount($status, $row['id_member']);
194 194
 		}
195 195
 	);
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
  * @param bool $enable if true enables the mentions, otherwise disables them
206 206
  * @package Mentions
207 207
  */
208
-function toggleMentionsVisibility($type, $enable)
208
+function toggleMentionsVisibility ($type, $enable)
209 209
 {
210 210
 	$db = database();
211 211
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
  * @param bool $access if true make the mentions accessible (if visible and other things), otherwise marks them as inaccessible
244 244
  * @package Mentions
245 245
  */
246
-function toggleMentionsAccessibility($mentions, $access)
246
+function toggleMentionsAccessibility ($mentions, $access)
247 247
 {
248 248
 	$db = database();
249 249
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
  * @package Mentions
273 273
  *
274 274
  */
275
-function validate_ownmention($field, $input, $validation_parameters = null)
275
+function validate_ownmention ($field, $input, $validation_parameters = null)
276 276
 {
277 277
 	if (!isset($input[$field]))
278 278
 	{
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
  * @return bool true if the mention belongs to the member, false otherwise
299 299
  * @package Mentions
300 300
  */
301
-function findMemberMention($id_mention, $id_member)
301
+function findMemberMention ($id_mention, $id_member)
302 302
 {
303 303
 	$db = database();
304 304
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
  * @param int $member_id
328 328
  * @package Mentions
329 329
  */
330
-function updateMentionMenuCount($status, $member_id)
330
+function updateMentionMenuCount ($status, $member_id)
331 331
 {
332 332
 	require_once(SUBSDIR . '/Members.subs.php');
333 333
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
  * @return int A timestamp (log_time)
356 356
  * @package Mentions
357 357
  */
358
-function getTimeLastMention($id_member)
358
+function getTimeLastMention ($id_member)
359 359
 {
360 360
 	$db = database();
361 361
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
  * @return int Number of new mentions
387 387
  * @package Mentions
388 388
  */
389
-function getNewMentions($id_member, $timestamp)
389
+function getNewMentions ($id_member, $timestamp)
390 390
 {
391 391
 	$db = database();
392 392
 
Please login to merge, or discard this patch.
sources/subs/Graphics.subs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
  * @return false|null false if something goes wrong.
36 36
  * @package Graphics
37 37
  */
38
-function showCodeImage($code)
38
+function showCodeImage ($code)
39 39
 {
40 40
 	global $settings, $modSettings;
41 41
 
Please login to merge, or discard this patch.
sources/subs/Maillist.subs.php 2 patches
Switch Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -105,15 +105,15 @@
 block discarded – undo
105 105
 			// Build a link to the topic or message in case someone wants to take a look at that thread
106 106
 			switch ($row['message_type'])
107 107
 			{
108
-				case 't':
109
-					$postemail[$i]['link'] = $boardurl . '?topic=' . $row['message_id'];
110
-					break;
111
-				case 'm':
112
-					$postemail[$i]['link'] = $boardurl . '?msg=' . $row['message_id'];
113
-					break;
114
-				case 'p':
115
-					$postemail[$i]['subject'] = $txt['private'];
116
-					break;
108
+			case 't':
109
+				$postemail[$i]['link'] = $boardurl . '?topic=' . $row['message_id'];
110
+				break;
111
+			case 'm':
112
+				$postemail[$i]['link'] = $boardurl . '?msg=' . $row['message_id'];
113
+				break;
114
+			case 'p':
115
+				$postemail[$i]['subject'] = $txt['private'];
116
+				break;
117 117
 			}
118 118
 
119 119
 			$i++;
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  * @package Maillist
30 30
  *
31 31
  */
32
-function list_maillist_unapproved($id = 0, $start = 0, $items_per_page = 0, $sort = '')
32
+function list_maillist_unapproved ($id = 0, $start = 0, $items_per_page = 0, $sort = '')
33 33
 {
34 34
 	$db = database();
35 35
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 			'id' => $id,
82 82
 		)
83 83
 	)->fetch_callback(
84
-		function ($row) use (&$postemail, &$i) {
84
+		function($row) use (&$postemail, &$i) {
85 85
 			global $txt, $boardurl;
86 86
 
87 87
 			$postemail[$i] = array(
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
  *
129 129
  * @package Maillist
130 130
  */
131
-function list_maillist_count_unapproved()
131
+function list_maillist_count_unapproved ()
132 132
 {
133 133
 	$db = database();
134 134
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
  * @param int $id
172 172
  * @package Maillist
173 173
  */
174
-function maillist_delete_error_entry($id)
174
+function maillist_delete_error_entry ($id)
175 175
 {
176 176
 	$db = database();
177 177
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
  * @package Maillist
202 202
  *
203 203
  */
204
-function list_get_filter_parser($start, $items_per_page, $sort = '', $id = 0, $style = 'filter')
204
+function list_get_filter_parser ($start, $items_per_page, $sort = '', $id = 0, $style = 'filter')
205 205
 {
206 206
 	$db = database();
207 207
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 			'style' => $style
232 232
 		)
233 233
 	)->fetch_callback(
234
-		function ($row) use (&$email_filters) {
234
+		function($row) use (&$email_filters) {
235 235
 			$email_filters[$row['id_filter']] = array(
236 236
 				'id_filter' => $row['id_filter'],
237 237
 				'filter_type' => $row['filter_type'],
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
  * @package Maillist
260 260
  *
261 261
  */
262
-function list_count_filter_parser($id, $style)
262
+function list_count_filter_parser ($id, $style)
263 263
 {
264 264
 	$db = database();
265 265
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
  * @package Maillist
295 295
  *
296 296
  */
297
-function maillist_load_filter_parser($id, $style)
297
+function maillist_load_filter_parser ($id, $style)
298 298
 {
299 299
 	$db = database();
300 300
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
  * @param int $id ID of the filter/parser
329 329
  * @package Maillist
330 330
  */
331
-function maillist_delete_filter_parser($id)
331
+function maillist_delete_filter_parser ($id)
332 332
 {
333 333
 	$db = database();
334 334
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
  *
352 352
  * @package Maillist
353 353
  */
354
-function maillist_board_list()
354
+function maillist_board_list ()
355 355
 {
356 356
 	$db = database();
357 357
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 			'zero' => 0,
368 368
 		)
369 369
 	)->fetch_callback(
370
-		function ($row) use (&$result) {
370
+		function($row) use (&$result) {
371 371
 			$result[$row['id_board']] = $row['name'];
372 372
 		}
373 373
 	);
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
  * @param bool $switch
382 382
  * @package Maillist
383 383
  */
384
-function enable_maillist_imap_cron($switch)
384
+function enable_maillist_imap_cron ($switch)
385 385
 {
386 386
 	$db = database();
387 387
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
  * @package Maillist
409 409
  *
410 410
  */
411
-function maillist_templates($template_type, $subject = null)
411
+function maillist_templates ($template_type, $subject = null)
412 412
 {
413 413
 	$db = database();
414 414
 
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 			'current_member' => User::$info->id,
425 425
 		)
426 426
 	)->fetch_callback(
427
-		function ($row) use ($subject) {
427
+		function($row) use ($subject) {
428 428
 			$template = array(
429 429
 				'title' => $row['template_title'],
430 430
 				'body' => $row['body'],
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
  * @param mixed[] $sent associative array of id_email, time_sent, email_to
447 447
  * @package Maillist
448 448
  */
449
-function log_email($sent)
449
+function log_email ($sent)
450 450
 {
451 451
 	$db = database();
452 452
 
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
  * @param int[] $filters list of ids in the WHEN clause to keep from updating the entire table
472 472
  * @package Maillist
473 473
  */
474
-function updateParserFilterOrder($replace, $filters)
474
+function updateParserFilterOrder ($replace, $filters)
475 475
 {
476 476
 	$db = database();
477 477
 
Please login to merge, or discard this patch.
sources/subs/Post.subs.php 3 patches
Switch Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -1152,32 +1152,32 @@  discard block
 block discarded – undo
1152 1152
 	switch ($editing)
1153 1153
 	{
1154 1154
 		// Modifying an existing message
1155
-		case 1:
1156
-			require_once(SUBSDIR . '/Messages.subs.php');
1155
+	case 1:
1156
+		require_once(SUBSDIR . '/Messages.subs.php');
1157 1157
 
1158
-			// Get the existing message.
1159
-			$message = messageDetails((int) $msg_id, (int) $topic);
1158
+		// Get the existing message.
1159
+		$message = messageDetails((int) $msg_id, (int) $topic);
1160 1160
 
1161
-			// The message they were trying to edit was most likely deleted.
1162
-			if ($message === false)
1163
-			{
1164
-				return false;
1165
-			}
1161
+		// The message they were trying to edit was most likely deleted.
1162
+		if ($message === false)
1163
+		{
1164
+			return false;
1165
+		}
1166 1166
 
1167
-			$errors = checkMessagePermissions($message['message']);
1167
+		$errors = checkMessagePermissions($message['message']);
1168 1168
 
1169
-			prepareMessageContext($message);
1169
+		prepareMessageContext($message);
1170 1170
 
1171
-			if (!empty($errors))
1172
-			{
1173
-				$message['errors'] = $errors;
1174
-			}
1171
+		if (!empty($errors))
1172
+		{
1173
+			$message['errors'] = $errors;
1174
+		}
1175 1175
 
1176
-			return $message;
1177
-		// Posting a quoted reply?
1178
-		case 2:
1179
-			// Make sure they _can_ quote this post, and if so get it.
1180
-			$request = $db->query('', '
1176
+		return $message;
1177
+	// Posting a quoted reply?
1178
+	case 2:
1179
+		// Make sure they _can_ quote this post, and if so get it.
1180
+		$request = $db->query('', '
1181 1181
 				SELECT
1182 1182
 					m.subject, COALESCE(mem.real_name, m.poster_name) AS poster_name, m.poster_time, m.body
1183 1183
 				FROM {db_prefix}messages AS m
@@ -1186,60 +1186,60 @@  discard block
 block discarded – undo
1186 1186
 				WHERE m.id_msg = {int:id_msg}' . (!$modSettings['postmod_active'] || allowedTo('approve_posts') ? '' : '
1187 1187
 					AND m.approved = {int:is_approved}') . '
1188 1188
 				LIMIT 1',
1189
-				array(
1190
-					'id_msg' => $msg_id,
1191
-					'is_approved' => 1,
1192
-				)
1193
-			);
1194
-			if ($request->num_rows() == 0)
1195
-			{
1196
-				throw new \ElkArte\Exceptions\Exception('quoted_post_deleted', false);
1197
-			}
1198
-			list ($form_subject, $mname, $mdate, $form_message) = $request->fetch_row();
1199
-			$request->free_result();
1189
+			array(
1190
+				'id_msg' => $msg_id,
1191
+				'is_approved' => 1,
1192
+			)
1193
+		);
1194
+		if ($request->num_rows() == 0)
1195
+		{
1196
+			throw new \ElkArte\Exceptions\Exception('quoted_post_deleted', false);
1197
+		}
1198
+		list ($form_subject, $mname, $mdate, $form_message) = $request->fetch_row();
1199
+		$request->free_result();
1200 1200
 
1201
-			// Add 'Re: ' to the front of the quoted subject.
1202
-			$response_prefix = response_prefix();
1203
-			if (trim($response_prefix) != '' && Util::strpos($form_subject, trim($response_prefix)) !== 0)
1204
-			{
1205
-				$form_subject = $response_prefix . $form_subject;
1206
-			}
1201
+		// Add 'Re: ' to the front of the quoted subject.
1202
+		$response_prefix = response_prefix();
1203
+		if (trim($response_prefix) != '' && Util::strpos($form_subject, trim($response_prefix)) !== 0)
1204
+		{
1205
+			$form_subject = $response_prefix . $form_subject;
1206
+		}
1207 1207
 
1208
-			// Censor the message and subject.
1209
-			$form_message = censor($form_message);
1210
-			$form_subject = censor($form_subject);
1208
+		// Censor the message and subject.
1209
+		$form_message = censor($form_message);
1210
+		$form_subject = censor($form_subject);
1211 1211
 
1212
-			$form_message = un_preparsecode($form_message);
1213
-			$form_message = removeNestedQuotes($form_message);
1212
+		$form_message = un_preparsecode($form_message);
1213
+		$form_message = removeNestedQuotes($form_message);
1214 1214
 
1215
-			// Add a quote string on the front and end.
1216
-			$form_message = '[quote author=' . $mname . ' link=msg=' . (int) $msg_id . ' date=' . $mdate . ']' . "\n" . rtrim($form_message) . "\n" . '[/quote]';
1215
+		// Add a quote string on the front and end.
1216
+		$form_message = '[quote author=' . $mname . ' link=msg=' . (int) $msg_id . ' date=' . $mdate . ']' . "\n" . rtrim($form_message) . "\n" . '[/quote]';
1217 1217
 
1218
-			break;
1219
-		// Posting a reply without a quote?
1220
-		case 3:
1221
-			// Get the first message's subject.
1222
-			$form_subject = $first_subject;
1218
+		break;
1219
+	// Posting a reply without a quote?
1220
+	case 3:
1221
+		// Get the first message's subject.
1222
+		$form_subject = $first_subject;
1223 1223
 
1224
-			// Add 'Re: ' to the front of the subject.
1225
-			$response_prefix = response_prefix();
1226
-			if (trim($response_prefix) != '' && $form_subject != '' && Util::strpos($form_subject, trim($response_prefix)) !== 0)
1227
-			{
1228
-				$form_subject = $response_prefix . $form_subject;
1229
-			}
1224
+		// Add 'Re: ' to the front of the subject.
1225
+		$response_prefix = response_prefix();
1226
+		if (trim($response_prefix) != '' && $form_subject != '' && Util::strpos($form_subject, trim($response_prefix)) !== 0)
1227
+		{
1228
+			$form_subject = $response_prefix . $form_subject;
1229
+		}
1230 1230
 
1231
-			// Censor the subject.
1232
-			$form_subject = censor($form_subject);
1231
+		// Censor the subject.
1232
+		$form_subject = censor($form_subject);
1233 1233
 
1234
-			$form_message = '';
1234
+		$form_message = '';
1235 1235
 
1236
-			break;
1237
-		case 4:
1238
-		default:
1239
-			$form_subject = $first_subject;
1240
-			$form_message = '';
1236
+		break;
1237
+	case 4:
1238
+	default:
1239
+		$form_subject = $first_subject;
1240
+		$form_message = '';
1241 1241
 
1242
-			break;
1242
+		break;
1243 1243
 	}
1244 1244
 
1245 1245
 	return array($form_subject, $form_message);
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
  * @param bool $previewing
33 33
  * @package Posts
34 34
  */
35
-function preparsecode(&$message, $previewing = false)
35
+function preparsecode (&$message, $previewing = false)
36 36
 {
37 37
 	$preparse = PreparseCode::instance(User::$info->name);
38 38
 	$preparse->preparsecode($message, $previewing);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
  * @package Posts
48 48
  *
49 49
  */
50
-function un_preparsecode($message)
50
+function un_preparsecode ($message)
51 51
 {
52 52
 	$un_preparse = PreparseCode::instance(User::$info->name);
53 53
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
  * @package Posts
71 71
  *
72 72
  */
73
-function createPost(&$msgOptions, &$topicOptions, &$posterOptions)
73
+function createPost (&$msgOptions, &$topicOptions, &$posterOptions)
74 74
 {
75 75
 	global $txt, $modSettings;
76 76
 
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
  * @package Posts
452 452
  *
453 453
  */
454
-function modifyPost(&$msgOptions, &$topicOptions, &$posterOptions)
454
+function modifyPost (&$msgOptions, &$topicOptions, &$posterOptions)
455 455
 {
456 456
 	global $modSettings;
457 457
 
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
  * @package Posts
627 627
  *
628 628
  */
629
-function approvePosts($msgs, $approve = true)
629
+function approvePosts ($msgs, $approve = true)
630 630
 {
631 631
 	global $modSettings;
632 632
 
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 				'approved' => 1,
784 784
 			)
785 785
 		)->fetch_callback(
786
-			function ($row) use (&$topic_changes) {
786
+			function($row) use (&$topic_changes) {
787 787
 				$topic_changes[$row['id_topic']]['id_last_msg'] = $row['id_last_msg'];
788 788
 			}
789 789
 		);
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
  * @package Posts
911 911
  *
912 912
  */
913
-function updateLastMessages($setboards, $id_msg = 0)
913
+function updateLastMessages ($setboards, $id_msg = 0)
914 914
 {
915 915
 	global $board_info, $board;
916 916
 
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
 				'approved' => 1,
946 946
 			)
947 947
 		)->fetch_callback(
948
-			function ($row) use (&$lastMsg) {
948
+			function($row) use (&$lastMsg) {
949 949
 				$lastMsg[$row['id_board']] = $row['id_msg'];
950 950
 			}
951 951
 		);
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
  * @return array
1072 1072
  * @package Posts
1073 1073
  */
1074
-function lastPost()
1074
+function lastPost ()
1075 1075
 {
1076 1076
 	global $scripturl, $modSettings;
1077 1077
 
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
  * @package Posts
1144 1144
  *
1145 1145
  */
1146
-function getFormMsgSubject($editing, $topic, $first_subject = '', $msg_id = 0)
1146
+function getFormMsgSubject ($editing, $topic, $first_subject = '', $msg_id = 0)
1147 1147
 {
1148 1148
 	global $modSettings;
1149 1149
 
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
  * @param bool $all = false
1257 1257
  * @package Posts
1258 1258
  */
1259
-function topicSubject($topic_info, $custom_subject, $response_prefix = '', $all = false)
1259
+function topicSubject ($topic_info, $custom_subject, $response_prefix = '', $all = false)
1260 1260
 {
1261 1261
 	$db = database();
1262 1262
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -735,10 +735,12 @@
 block discarded – undo
735 735
 		}
736 736
 		// If this is being unapproved, and it's equal to the id_last_msg we need to find a new one!
737 737
 		elseif (!$approve)
738
-			// Default to the first message and then we'll override in a bit ;)
738
+		{
739
+					// Default to the first message and then we'll override in a bit ;)
739 740
 		{
740 741
 			$topic_changes[$row['id_topic']]['id_last_msg'] = $row['id_first_msg'];
741 742
 		}
743
+		}
742 744
 
743 745
 		$topic_changes[$row['id_topic']]['unapproved_posts'] += $approve ? -1 : 1;
744 746
 		$board_changes[$row['id_board']]['unapproved_posts'] += $approve ? -1 : 1;
Please login to merge, or discard this patch.
sources/subs/Categories.subs.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
  * @param int $category_id
25 25
  * @param mixed[] $catOptions
26 26
  */
27
-function modifyCategory($category_id, $catOptions)
27
+function modifyCategory ($category_id, $catOptions)
28 28
 {
29 29
 	$db = database();
30 30
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 			ORDER BY cat_order',
56 56
 			array()
57 57
 		)->fetch_callback(
58
-			function ($row) use (&$cat_order, &$cats, $category_id, $catOptions) {
58
+			function($row) use (&$cat_order, &$cats, $category_id, $catOptions) {
59 59
 				if ($row['id_cat'] != $category_id)
60 60
 				{
61 61
 					$cats[] = $row['id_cat'];
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
  *
139 139
  * @param mixed[] $catOptions
140 140
  */
141
-function createCategory($catOptions)
141
+function createCategory ($catOptions)
142 142
 {
143 143
 	$db = database();
144 144
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
  * @param int[] $categories
202 202
  * @param int|null $moveBoardsTo = null
203 203
  */
204
-function deleteCategories($categories, $moveBoardsTo = null)
204
+function deleteCategories ($categories, $moveBoardsTo = null)
205 205
 {
206 206
 	$db = database();
207 207
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
  * @param int[]|null $members = null
281 281
  * @param bool $check_collapsable = true
282 282
  */
283
-function collapseCategories($categories, $new_status, $members = null, $check_collapsable = true)
283
+function collapseCategories ($categories, $new_status, $members = null, $check_collapsable = true)
284 284
 {
285 285
 	$db = database();
286 286
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 				'member_list' => $members,
339 339
 			)
340 340
 		)->fetch_callback(
341
-			function ($row) use (&$updates, $check_collapsable) {
341
+			function($row) use (&$updates, $check_collapsable) {
342 342
 				if (empty($row['is_collapsed']) && (!empty($row['can_collapse']) || !$check_collapsable))
343 343
 				{
344 344
 					$updates['insert'][] = array($row['id_member'], $row['id_cat']);
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
  * @param int $id_cat
382 382
  * @return string
383 383
  */
384
-function categoryName($id_cat)
384
+function categoryName ($id_cat)
385 385
 {
386 386
 	$db = database();
387 387
 
Please login to merge, or discard this patch.
sources/subs/Boards.subs.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
  * @param bool $resetTopics = false
29 29
  * @package Boards
30 30
  */
31
-function markBoardsRead($boards, $unread = false, $resetTopics = false)
31
+function markBoardsRead ($boards, $unread = false, $resetTopics = false)
32 32
 {
33 33
 	global $modSettings;
34 34
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 				'lowest_topic' => $lowest_topic,
144 144
 			)
145 145
 		)->fetch_callback(
146
-			function ($row) use (&$delete_topics, &$update_topics, $modSettings) {
146
+			function($row) use (&$delete_topics, &$update_topics, $modSettings) {
147 147
 				if (!empty($row['unwatched']))
148 148
 				{
149 149
 					$update_topics[] = array(
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
  * @return int the member id
198 198
  * @package Boards
199 199
  */
200
-function getMsgMemberID($messageID)
200
+function getMsgMemberID ($messageID)
201 201
 {
202 202
 	require_once(SUBSDIR . '/Messages.subs.php');
203 203
 	$message_info = basicMessageInfo((int) $messageID, true);
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
  * @package Boards
218 218
  *
219 219
  */
220
-function modifyBoard($board_id, &$boardOptions)
220
+function modifyBoard ($board_id, &$boardOptions)
221 221
 {
222 222
 	$db = database();
223 223
 
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 						'moderator_list' => $moderators,
498 498
 					)
499 499
 				)->fetch_callback(
500
-					function ($row) {
500
+					function($row) {
501 501
 						return $row['id_member'];
502 502
 					}
503 503
 				);
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
  * @return int The new board id
550 550
  * @package Boards
551 551
  */
552
-function createBoard($boardOptions)
552
+function createBoard ($boardOptions)
553 553
 {
554 554
 	$db = database();
555 555
 
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
  * @return array An array of boards sorted according to the normal boards order
651 651
  * @package Boards
652 652
  */
653
-function getBoardList($boardListOptions = array(), $simple = false)
653
+function getBoardList ($boardListOptions = array(), $simple = false)
654 654
 {
655 655
 	global $modSettings;
656 656
 
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
  * @return array list of child boards id
851 851
  * @package Boards
852 852
  */
853
-function recursiveBoards($tree)
853
+function recursiveBoards ($tree)
854 854
 {
855 855
 	if (empty($tree['children']))
856 856
 	{
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
  * @param int $id_board the board to check
875 875
  * @return bool if they have notifications turned on for the board
876 876
  */
877
-function hasBoardNotification($id_member, $id_board)
877
+function hasBoardNotification ($id_member, $id_board)
878 878
 {
879 879
 	$db = database();
880 880
 
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
  * @param bool $on = false
906 906
  * @package Boards
907 907
  */
908
-function setBoardNotification($id_member, $id_board, $on = false)
908
+function setBoardNotification ($id_member, $id_board, $on = false)
909 909
 {
910 910
 	$db = database();
911 911
 
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
  * @return bool if the board was marked for notifications
948 948
  * @package Boards
949 949
  */
950
-function resetSentBoardNotification($id_member, $id_board, $check = true)
950
+function resetSentBoardNotification ($id_member, $id_board, $check = true)
951 951
 {
952 952
 	$db = database();
953 953
 
@@ -1006,7 +1006,7 @@  discard block
 block discarded – undo
1006 1006
  * @return int
1007 1007
  * @package Boards
1008 1008
  */
1009
-function getBoardNotificationsCount($memID)
1009
+function getBoardNotificationsCount ($memID)
1010 1010
 {
1011 1011
 	$db = database();
1012 1012
 
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
  * @package Boards
1045 1045
  *
1046 1046
  */
1047
-function accessibleBoards($id_boards = null, $id_parents = null)
1047
+function accessibleBoards ($id_boards = null, $id_parents = null)
1048 1048
 {
1049 1049
 	$db = database();
1050 1050
 
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
  * @package Boards
1108 1108
  *
1109 1109
  */
1110
-function wantedBoards($see_board, $hide_recycle = true)
1110
+function wantedBoards ($see_board, $hide_recycle = true)
1111 1111
 {
1112 1112
 	global $modSettings;
1113 1113
 
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
 			'recycle_board' => (int) $modSettings['recycle_board'],
1129 1129
 		)
1130 1130
 	)->fetch_callback(
1131
-		function ($row) {
1131
+		function($row) {
1132 1132
 			return $row['id_board'];
1133 1133
 		}
1134 1134
 	);
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
  * @return mixed[]
1146 1146
  * @package Boards
1147 1147
  */
1148
-function boardInfo($board_id, $topic_id = null)
1148
+function boardInfo ($board_id, $topic_id = null)
1149 1149
 {
1150 1150
 	$db = database();
1151 1151
 
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
  * @return array
1200 1200
  * @package Boards
1201 1201
  */
1202
-function getOtherGroups($curBoard, $new_board = false)
1202
+function getOtherGroups ($curBoard, $new_board = false)
1203 1203
 {
1204 1204
 	$db = database();
1205 1205
 
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
 			'global_moderator' => 2,
1218 1218
 		)
1219 1219
 	)->fetch_callback(
1220
-		function ($row) use (&$new_board, &$groups, &$curBoard) {
1220
+		function($row) use (&$new_board, &$groups, &$curBoard) {
1221 1221
 			if ($new_board && $row['min_posts'] == -1)
1222 1222
 			{
1223 1223
 				$curBoard['member_groups'][] = $row['id_group'];
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
  * @return array
1245 1245
  * @package Boards
1246 1246
  */
1247
-function getBoardModerators($idboard, $only_id = false)
1247
+function getBoardModerators ($idboard, $only_id = false)
1248 1248
 {
1249 1249
 	$db = database();
1250 1250
 
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 				'current_board' => $idboard,
1262 1262
 			)
1263 1263
 		)->fetch_callback(
1264
-			function ($row) use (&$moderators) {
1264
+			function($row) use (&$moderators) {
1265 1265
 				$moderators[] = $row['id_member'];
1266 1266
 			}
1267 1267
 		);
@@ -1277,7 +1277,7 @@  discard block
 block discarded – undo
1277 1277
 				'current_board' => $idboard,
1278 1278
 			)
1279 1279
 		)->fetch_callback(
1280
-			function ($row) use (&$moderators) {
1280
+			function($row) use (&$moderators) {
1281 1281
 				$moderators[$row['id_member']] = $row['real_name'];
1282 1282
 			}
1283 1283
 		);
@@ -1294,7 +1294,7 @@  discard block
 block discarded – undo
1294 1294
  * @return array
1295 1295
  * @package Boards
1296 1296
  */
1297
-function allBoardModerators($only_id = false)
1297
+function allBoardModerators ($only_id = false)
1298 1298
 {
1299 1299
 	$db = database();
1300 1300
 
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
  * @return array
1344 1344
  * @package Boards
1345 1345
  */
1346
-function boardsModerated($id_member)
1346
+function boardsModerated ($id_member)
1347 1347
 {
1348 1348
 	$db = database();
1349 1349
 
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
 			'current_member' => $id_member,
1357 1357
 		)
1358 1358
 	)->fetch_callback(
1359
-		function ($row) {
1359
+		function($row) {
1360 1360
 			return $row['id_board'];
1361 1361
 		}
1362 1362
 	);
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
  * @return array
1369 1369
  * @package Boards
1370 1370
  */
1371
-function getAllThemes()
1371
+function getAllThemes ()
1372 1372
 {
1373 1373
 	$db = database();
1374 1374
 
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
  * @return array
1392 1392
  * @package Boards
1393 1393
  */
1394
-function getBoardProperties($idboard)
1394
+function getBoardProperties ($idboard)
1395 1395
 {
1396 1396
 	$db = database();
1397 1397
 
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
  * @package Boards
1425 1425
  *
1426 1426
  */
1427
-function boardsPosts($boards, $categories, $wanna_see_board = false, $include_recycle = true)
1427
+function boardsPosts ($boards, $categories, $wanna_see_board = false, $include_recycle = true)
1428 1428
 {
1429 1429
 	global $modSettings;
1430 1430
 
@@ -1467,7 +1467,7 @@  discard block
 block discarded – undo
1467 1467
 			AND b.' . implode(' AND b.', $removals) : ''),
1468 1468
 		$clauseParameters
1469 1469
 	)->fetch_callback(
1470
-		function ($row) use (&$return) {
1470
+		function($row) use (&$return) {
1471 1471
 			$return[$row['id_board']] = $row['num_posts'];
1472 1472
 		}
1473 1473
 	);
@@ -1479,7 +1479,7 @@  discard block
 block discarded – undo
1479 1479
  * Returns the total sum of posts in the boards defined by query_wanna_see_board
1480 1480
  * Excludes the count of any boards defined as a recycle board from the sum
1481 1481
  */
1482
-function sumRecentPosts()
1482
+function sumRecentPosts ()
1483 1483
 {
1484 1484
 	$db = database();
1485 1485
 
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
  *
1526 1526
  * @todo unify the two queries?
1527 1527
  */
1528
-function fetchBoardsInfo($conditions = 'all', $params = array())
1528
+function fetchBoardsInfo ($conditions = 'all', $params = array())
1529 1529
 {
1530 1530
 	global $modSettings;
1531 1531
 
@@ -1643,7 +1643,7 @@  discard block
 block discarded – undo
1643 1643
  * @return bool|int[]
1644 1644
  * @package Boards
1645 1645
  */
1646
-function addChildBoards($boards)
1646
+function addChildBoards ($boards)
1647 1647
 {
1648 1648
 	$db = database();
1649 1649
 
@@ -1671,7 +1671,7 @@  discard block
 block discarded – undo
1671 1671
 			'board_list' => $boards,
1672 1672
 		)
1673 1673
 	)->fetch_callback(
1674
-		function ($row) use (&$boards) {
1674
+		function($row) use (&$boards) {
1675 1675
 			if (in_array($row['id_parent'], $boards))
1676 1676
 			{
1677 1677
 				$boards[] = $row['id_board'];
@@ -1689,7 +1689,7 @@  discard block
 block discarded – undo
1689 1689
  * @param mixed[]|string $values an array of index => value of a string representing the index to increment
1690 1690
  * @package Boards
1691 1691
  */
1692
-function incrementBoard($id_board, $values)
1692
+function incrementBoard ($id_board, $values)
1693 1693
 {
1694 1694
 	$db = database();
1695 1695
 
@@ -1735,7 +1735,7 @@  discard block
 block discarded – undo
1735 1735
  * @param mixed[]|string $values an array of index => value of a string representing the index to decrement
1736 1736
  * @package Boards
1737 1737
  */
1738
-function decrementBoard($id_board, $values)
1738
+function decrementBoard ($id_board, $values)
1739 1739
 {
1740 1740
 	$db = database();
1741 1741
 
@@ -1788,7 +1788,7 @@  discard block
 block discarded – undo
1788 1788
  * @package Boards
1789 1789
  *
1790 1790
  */
1791
-function boardNotifications($sort, $memID)
1791
+function boardNotifications ($sort, $memID)
1792 1792
 {
1793 1793
 	global $modSettings;
1794 1794
 
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
 			'selected_member' => $memID,
1810 1810
 		)
1811 1811
 	)->fetch_callback(
1812
-		function ($row) {
1812
+		function($row) {
1813 1813
 			$href = getUrl('board', ['board' => $row['id_board'], 'start' => '0', 'name' => $row['name']]);
1814 1814
 
1815 1815
 			return array(
@@ -1840,7 +1840,7 @@  discard block
 block discarded – undo
1840 1840
 			'recycle_board' => $modSettings['recycle_board'],
1841 1841
 		)
1842 1842
 	)->fetch_callback(
1843
-		function ($row) use (&$notification_boards) {
1843
+		function($row) use (&$notification_boards) {
1844 1844
 			$href = getUrl('board', ['board' => $row['id_board'], 'start' => '0', 'name' => $row['name']]);
1845 1845
 			$notification_boards[] = array(
1846 1846
 				'id' => $row['id_board'],
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
  * @return int
1871 1871
  * @package Boards
1872 1872
  */
1873
-function countBoards($conditions = 'all', $params = array())
1873
+function countBoards ($conditions = 'all', $params = array())
1874 1874
 {
1875 1875
 	global $modSettings;
1876 1876
 
Please login to merge, or discard this patch.
sources/subs/SearchEngines.subs.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
  * @return bool
24 24
  * @package SearchEngines
25 25
  */
26
-function spiderCheck()
26
+function spiderCheck ()
27 27
 {
28 28
 	global $modSettings;
29 29
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
  * @return bool
134 134
  * @package SearchEngines
135 135
  */
136
-function spiderQuickCheck()
136
+function spiderQuickCheck ()
137 137
 {
138 138
 	// We need the user agent
139 139
 	$req = request();
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
  *
148 148
  * @package SearchEngines
149 149
  */
150
-function logSpider()
150
+function logSpider ()
151 151
 {
152 152
 	global $modSettings, $context;
153 153
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
  *
226 226
  * @package SearchEngines
227 227
  */
228
-function consolidateSpiderStats()
228
+function consolidateSpiderStats ()
229 229
 {
230 230
 	$db = database();
231 231
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
  *
300 300
  * @package SearchEngines
301 301
  */
302
-function recacheSpiderNames()
302
+function recacheSpiderNames ()
303 303
 {
304 304
 	$db = database();
305 305
 
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 		FROM {db_prefix}spiders',
311 311
 		array()
312 312
 	)->fetch_callback(
313
-		function ($row) use (&$spiders) {
313
+		function($row) use (&$spiders) {
314 314
 			$spiders[$row['id_spider']] = $row['spider_name'];
315 315
 		}
316 316
 	);
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
  * @package SearchEngines
331 331
  *
332 332
  */
333
-function getSpiders($start, $items_per_page, $sort)
333
+function getSpiders ($start, $items_per_page, $sort)
334 334
 {
335 335
 	$db = database();
336 336
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 			'limit' => $items_per_page,
348 348
 		)
349 349
 	)->fetch_callback(
350
-		function ($row) use (&$spiders) {
350
+		function($row) use (&$spiders) {
351 351
 			$spiders[$row['id_spider']] = $row;
352 352
 		}
353 353
 	);
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
  * @return mixed[]
363 363
  * @package SearchEngines
364 364
  */
365
-function getSpiderDetails($spider_id)
365
+function getSpiderDetails ($spider_id)
366 366
 {
367 367
 	$db = database();
368 368
 
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
  * @return int
389 389
  * @package SearchEngines
390 390
  */
391
-function getNumSpiders()
391
+function getNumSpiders ()
392 392
 {
393 393
 	$db = database();
394 394
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
  * @return array An array of spider hits
416 416
  * @package SearchEngines
417 417
  */
418
-function getSpiderLogs($start, $items_per_page, $sort)
418
+function getSpiderLogs ($start, $items_per_page, $sort)
419 419
 {
420 420
 	$db = database();
421 421
 
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
  * @return int The number of rows in the log_spider_hits table
438 438
  * @package SearchEngines
439 439
  */
440
-function getNumSpiderLogs()
440
+function getNumSpiderLogs ()
441 441
 {
442 442
 	$db = database();
443 443
 
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
  * @package SearchEngines
467 467
  *
468 468
  */
469
-function getSpiderStats($start, $items_per_page, $sort)
469
+function getSpiderStats ($start, $items_per_page, $sort)
470 470
 {
471 471
 	$db = database();
472 472
 
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
  * @return int The number of rows in the log_spider_stats table
490 490
  * @package SearchEngines
491 491
  */
492
-function getNumSpiderStats($time = null)
492
+function getNumSpiderStats ($time = null)
493 493
 {
494 494
 	$db = database();
495 495
 
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
  * @param int $time a time value
515 515
  * @package SearchEngines
516 516
  */
517
-function removeSpiderOldLogs($time)
517
+function removeSpiderOldLogs ($time)
518 518
 {
519 519
 	$db = database();
520 520
 
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
  * @param int $time a time value
535 535
  * @package SearchEngines
536 536
  */
537
-function removeSpiderOldStats($time)
537
+function removeSpiderOldStats ($time)
538 538
 {
539 539
 	$db = database();
540 540
 
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
  * @param int[] $spiders_id an array of spider ids
555 555
  * @package SearchEngines
556 556
  */
557
-function removeSpiders($spiders_id)
557
+function removeSpiders ($spiders_id)
558 558
 {
559 559
 	$db = database();
560 560
 
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
  *
587 587
  * @package SearchEngines
588 588
  */
589
-function spidersLastSeen()
589
+function spidersLastSeen ()
590 590
 {
591 591
 	$db = database();
592 592
 
@@ -598,7 +598,7 @@  discard block
 block discarded – undo
598 598
 		GROUP BY id_spider',
599 599
 		array()
600 600
 	)->fetch_callback(
601
-		function ($row) use (&$spider_last_seen) {
601
+		function($row) use (&$spider_last_seen) {
602 602
 			$spider_last_seen[$row['id_spider']] = $row['last_seen_time'];
603 603
 		}
604 604
 	);
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
  *
612 612
  * @package SearchEngines
613 613
  */
614
-function spidersStatsDates()
614
+function spidersStatsDates ()
615 615
 {
616 616
 	global $txt;
617 617
 
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
  * @param string $info_ip
666 666
  * @package SearchEngines
667 667
  */
668
-function updateSpider($id = 0, $name = '', $agent = '', $info_ip = '')
668
+function updateSpider ($id = 0, $name = '', $agent = '', $info_ip = '')
669 669
 {
670 670
 	$db = database();
671 671
 
Please login to merge, or discard this patch.
sources/subs/Sound.subs.php 2 patches
Switch Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -80,36 +80,36 @@
 block discarded – undo
80 80
 		$sound_letter = substr($sound_letter, strpos($sound_letter, 'data') + 8);
81 81
 		switch ($word[$i] === 's' ? 0 : mt_rand(0, 2))
82 82
 		{
83
-			case 0:
84
-				for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++)
83
+		case 0:
84
+			for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++)
85
+			{
86
+				for ($k = 0, $m = round(mt_rand(15, 25) / 10); $k < $m; $k++)
85 87
 				{
86
-					for ($k = 0, $m = round(mt_rand(15, 25) / 10); $k < $m; $k++)
87
-					{
88
-						$sound_word .= $word[$i] === 's' ? $sound_letter[$j] : chr(mt_rand(max(ord($sound_letter[$j]) - 1, 0x00), min(ord($sound_letter[$j]) + 1, 0xFF)));
89
-					}
88
+					$sound_word .= $word[$i] === 's' ? $sound_letter[$j] : chr(mt_rand(max(ord($sound_letter[$j]) - 1, 0x00), min(ord($sound_letter[$j]) + 1, 0xFF)));
90 89
 				}
91
-				break;
92
-			case 1:
93
-				for ($j = 0, $n = strlen($sound_letter) - 1; $j < $n; $j += 2)
90
+			}
91
+			break;
92
+		case 1:
93
+			for ($j = 0, $n = strlen($sound_letter) - 1; $j < $n; $j += 2)
94
+			{
95
+				$sound_word .= (mt_rand(0, 3) == 0 ? '' : $sound_letter[$j]) . (mt_rand(0, 3) === 0 ? $sound_letter[$j + 1] : $sound_letter[$j]) . (mt_rand(0, 3) === 0 ? $sound_letter[$j] : $sound_letter[$j + 1]) . $sound_letter[$j + 1] . (mt_rand(0, 3) == 0 ? $sound_letter[$j + 1] : '');
96
+			}
97
+			$sound_word .= str_repeat($sound_letter[$n], 2);
98
+			break;
99
+		case 2:
100
+			$shift = 0;
101
+			for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++)
102
+			{
103
+				if (mt_rand(0, 10) === 0)
94 104
 				{
95
-					$sound_word .= (mt_rand(0, 3) == 0 ? '' : $sound_letter[$j]) . (mt_rand(0, 3) === 0 ? $sound_letter[$j + 1] : $sound_letter[$j]) . (mt_rand(0, 3) === 0 ? $sound_letter[$j] : $sound_letter[$j + 1]) . $sound_letter[$j + 1] . (mt_rand(0, 3) == 0 ? $sound_letter[$j + 1] : '');
105
+					$shift += mt_rand(-3, 3);
96 106
 				}
97
-				$sound_word .= str_repeat($sound_letter[$n], 2);
98
-				break;
99
-			case 2:
100
-				$shift = 0;
101
-				for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++)
107
+				for ($k = 0, $m = round(mt_rand(15, 25) / 10); $k < $m; $k++)
102 108
 				{
103
-					if (mt_rand(0, 10) === 0)
104
-					{
105
-						$shift += mt_rand(-3, 3);
106
-					}
107
-					for ($k = 0, $m = round(mt_rand(15, 25) / 10); $k < $m; $k++)
108
-					{
109
-						$sound_word .= chr(min(max(ord($sound_letter[$j]) + $shift, 0x00), 0xFF));
110
-					}
109
+					$sound_word .= chr(min(max(ord($sound_letter[$j]) + $shift, 0x00), 0xFF));
111 110
 				}
112
-				break;
111
+			}
112
+			break;
113 113
 		}
114 114
 
115 115
 		$sound_word .= str_repeat(chr(0x80), mt_rand(10000, 10500));
Please login to merge, or discard this patch.
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  *
30 30
  * @return bool
31 31
  */
32
-function createWaveFile($word)
32
+function createWaveFile ($word)
33 33
 {
34 34
 	global $settings;
35 35
 
@@ -80,8 +80,7 @@  discard block
 block discarded – undo
80 80
 		$sound_letter = substr($sound_letter, strpos($sound_letter, 'data') + 8);
81 81
 		switch ($word[$i] === 's' ? 0 : mt_rand(0, 2))
82 82
 		{
83
-			case 0:
84
-				for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++)
83
+			case 0 : for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++)
85 84
 				{
86 85
 					for ($k = 0, $m = round(mt_rand(15, 25) / 10); $k < $m; $k++)
87 86
 					{
@@ -172,7 +171,7 @@  discard block
 block discarded – undo
172 171
  * @param int $file_size
173 172
  * @return array
174 173
  */
175
-function set_range($file_size)
174
+function set_range ($file_size)
176 175
 {
177 176
 	$range = array(0, $file_size - 1);
178 177
 
Please login to merge, or discard this patch.
sources/subs/ManageSearch.subs.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  *
23 23
  * @package Search
24 24
  */
25
-function detectFulltextIndex()
25
+function detectFulltextIndex ()
26 26
 {
27 27
 	global $context, $db_prefix;
28 28
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		FROM {db_prefix}messages',
35 35
 		array()
36 36
 	)->fetch_callback(
37
-		function ($row) use (&$fulltext_index) {
37
+		function($row) use (&$fulltext_index) {
38 38
 			if (($row['Column_name'] === 'body' || $row['Column_name'] === 'subject')
39 39
 				&& (isset($row['Index_type']) && $row['Index_type'] === 'FULLTEXT'
40 40
 					|| isset($row['Comment']) && $row['Comment'] === 'FULLTEXT'))
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 /**
83 83
  * Attempts to determine the version of the Sphinx damon
84 84
  */
85
-function SphinxVersion()
85
+function SphinxVersion ()
86 86
 {
87 87
 	$version = '0.0.0';
88 88
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
  *
102 102
  * @package Search
103 103
  */
104
-function createSphinxConfig()
104
+function createSphinxConfig ()
105 105
 {
106 106
 	global $db_server, $db_name, $db_user, $db_passwd, $db_prefix, $modSettings;
107 107
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
  * @param bool $add
293 293
  * @package Search
294 294
  */
295
-function alterFullTextIndex($table, $indexes, $add = false)
295
+function alterFullTextIndex ($table, $indexes, $add = false)
296 296
 {
297 297
 	$db = database();
298 298
 
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
  * @package Search
335 335
  *
336 336
  */
337
-function createSearchIndex($start, $messages_per_batch)
337
+function createSearchIndex ($start, $messages_per_batch)
338 338
 {
339 339
 	global $modSettings;
340 340
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
 			'starting_id' => $start,
377 377
 		)
378 378
 	)->fetch_callback(
379
-		function ($row) use (&$num_messages) {
379
+		function($row) use (&$num_messages) {
380 380
 			$num_messages[empty($row['todo']) ? 'done' : 'todo'] = $row['num_messages'];
381 381
 		}
382 382
 	);
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 					'limit' => $messages_per_batch,
411 411
 				)
412 412
 			)->fetch_callback(
413
-				function ($row) use (&$forced_break, &$number_processed, &$inserts, $stop) {
413
+				function($row) use (&$forced_break, &$number_processed, &$inserts, $stop) {
414 414
 					// In theory it's possible for one of these to take friggin ages so add more timeout protection.
415 415
 					if ($stop < time() || $forced_break)
416 416
 					{
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
  * @return array
469 469
  * @package Search
470 470
  */
471
-function removeCommonWordsFromIndex($start)
471
+function removeCommonWordsFromIndex ($start)
472 472
 {
473 473
 	global $modSettings;
474 474
 
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 				'minimum_messages' => $max_occurrences,
498 498
 			)
499 499
 		)->fetch_callback(
500
-			function ($row) use (&$stop_words) {
500
+			function($row) use (&$stop_words) {
501 501
 				$stop_words[] = $row['id_word'];
502 502
 			}
503 503
 		);
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
  *
536 536
  * @package Search
537 537
  */
538
-function drop_log_search_words()
538
+function drop_log_search_words ()
539 539
 {
540 540
 	$db_table = db_table();
541 541
 
Please login to merge, or discard this patch.