Passed
Pull Request — development (#3792)
by Spuds
06:41
created
sources/ElkArte/Controller/PostModeration.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -450,7 +450,7 @@
 block discarded – undo
450 450
 						'value' => $txt['post'],
451 451
 					),
452 452
 					'data' => array(
453
-						'function' => static function ($data) {
453
+						'function' => static function($data) {
454 454
 							global $modSettings;
455 455
 							return '<a href="' . $data['message']['href'] . '">' . Util::shorten_text($data['message']['subject'], empty($modSettings['subject_length']) ? 32 : $modSettings['subject_length']) . '</a>';
456 456
 						},
Please login to merge, or discard this patch.
sources/ElkArte/Controller/Likes.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
 
213 213
 		// An error if not possible to like.
214 214
 		if (!$this->_doLikePost('+', 'likemsg') && empty($this->_likes_response)) {
215
-      Txt::load('Errors');
216
-      $this->_likes_response = array('result' => false, 'data' => $txt['like_unlike_error']);
215
+	  Txt::load('Errors');
216
+	  $this->_likes_response = array('result' => false, 'data' => $txt['like_unlike_error']);
217 217
   }
218 218
 
219 219
 		$this->likeResponse();
@@ -263,8 +263,8 @@  discard block
 block discarded – undo
263 263
 
264 264
 		// An error if not possible to like.
265 265
 		if (!$this->_doLikePost('-', 'rlikemsg') && empty($this->_likes_response)) {
266
-      Txt::load('Errors');
267
-      $this->_likes_response = array('result' => false, 'data' => $txt['like_unlike_error']);
266
+	  Txt::load('Errors');
267
+	  $this->_likes_response = array('result' => false, 'data' => $txt['like_unlike_error']);
268 268
   }
269 269
 
270 270
 		$this->likeResponse();
@@ -392,9 +392,9 @@  discard block
 block discarded – undo
392 392
 					),
393 393
 					'data' => array(
394 394
 						'function' => static function ($row) {
395
-          global $txt;
396
-          return '<a href="' . $row['who'] . '" title="' . $txt['likes_show_who'] . '"><i class="icon i-users"></i></a>';
397
-      },
395
+		  global $txt;
396
+		  return '<a href="' . $row['who'] . '" title="' . $txt['likes_show_who'] . '"><i class="icon i-users"></i></a>';
397
+	  },
398 398
 						'class' => 'centertext',
399 399
 						'style' => 'width: 10%',
400 400
 					),
@@ -525,9 +525,9 @@  discard block
 block discarded – undo
525 525
 					),
526 526
 					'data' => array(
527 527
 						'function' => static function ($row) {
528
-          global $txt;
529
-          return '<a href="' . $row['delete'] . '" onclick="return confirm(\'' . $txt['likes_confirm_delete'] . '\');" title="' . $txt['likes_delete'] . '"><i class="icon i-delete"></i></a>';
530
-      },
528
+		  global $txt;
529
+		  return '<a href="' . $row['delete'] . '" onclick="return confirm(\'' . $txt['likes_confirm_delete'] . '\');" title="' . $txt['likes_delete'] . '"><i class="icon i-delete"></i></a>';
530
+	  },
531 531
 						'class' => 'centertext',
532 532
 						'style' => 'width: 10%',
533 533
 					),
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 		{
238 238
 			$details = loadLikes($this->_id_liked, true);
239 239
 			$count = empty($details) ? 0 : $details[$this->_id_liked]['count'];
240
-			$youLiked = $count !== 0 && array_key_exists(User::$info->id , $details[$this->_id_liked]['member']);
240
+			$youLiked = $count !== 0 && array_key_exists(User::$info->id, $details[$this->_id_liked]['member']);
241 241
 			$text = $count !== 0 ? ($youLiked ? $txt['unlike_post'] : $txt['likes']) : $txt['like_post'];
242 242
 			$title = empty($details) ? '' : $txt['liked_by'] . ' ' . implode(', ', $details[$this->_id_liked]['member']);
243 243
 			$this->_likes_response = [
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 						'class' => 'centertext',
392 392
 					),
393 393
 					'data' => array(
394
-						'function' => static function ($row) {
394
+						'function' => static function($row) {
395 395
           global $txt;
396 396
           return '<a href="' . $row['who'] . '" title="' . $txt['likes_show_who'] . '"><i class="icon i-users"></i></a>';
397 397
       },
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 						'class' => 'centertext',
525 525
 					),
526 526
 					'data' => array(
527
-						'function' => static function ($row) {
527
+						'function' => static function($row) {
528 528
           global $txt;
529 529
           return '<a href="' . $row['delete'] . '" onclick="return confirm(\'' . $txt['likes_confirm_delete'] . '\');" title="' . $txt['likes_delete'] . '"><i class="icon i-delete"></i></a>';
530 530
       },
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -211,7 +211,8 @@  discard block
 block discarded – undo
211 211
 		global $txt;
212 212
 
213 213
 		// An error if not possible to like.
214
-		if (!$this->_doLikePost('+', 'likemsg') && empty($this->_likes_response)) {
214
+		if (!$this->_doLikePost('+', 'likemsg') && empty($this->_likes_response))
215
+		{
215 216
       Txt::load('Errors');
216 217
       $this->_likes_response = array('result' => false, 'data' => $txt['like_unlike_error']);
217 218
   }
@@ -262,7 +263,8 @@  discard block
 block discarded – undo
262 263
 		global $txt;
263 264
 
264 265
 		// An error if not possible to like.
265
-		if (!$this->_doLikePost('-', 'rlikemsg') && empty($this->_likes_response)) {
266
+		if (!$this->_doLikePost('-', 'rlikemsg') && empty($this->_likes_response))
267
+		{
266 268
       Txt::load('Errors');
267 269
       $this->_likes_response = array('result' => false, 'data' => $txt['like_unlike_error']);
268 270
   }
Please login to merge, or discard this patch.
sources/ElkArte/Controller/Groups.php 3 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 					),
145 145
 					'data' => array(
146 146
 						'function' => static function ($rowData) use ($base_type, $base_params) {
147
-          // Since the moderator group has no explicit members, no link is needed.
148
-          if ($rowData['id_group'] == 3)
147
+		  // Since the moderator group has no explicit members, no link is needed.
148
+		  if ($rowData['id_group'] == 3)
149 149
    							{
150 150
    								$group_name = $rowData['group_name'];
151 151
    							}
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
    								$url = getUrl($base_type, array_merge($base_params, ['group' => $rowData['id_group']]));
155 155
    								$group_name = sprintf('<a href="%1$s">%2$s</a>', $url, $rowData['group_name_color']);
156 156
    							}
157
-          // Add a help option for moderator and administrator.
158
-          if ($rowData['id_group'] == 1)
157
+		  // Add a help option for moderator and administrator.
158
+		  if ($rowData['id_group'] == 1)
159 159
    							{
160 160
    								$group_name .= ' (<a href="' . getUrl('action', ['action' => 'quickhelp', 'help' => 'membergroup_administrator']) . '" onclick="return reqOverlayDiv(this.href);" class="helpicon i-help"></a>)';
161 161
    							}
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
    							{
164 164
    								$group_name .= ' (<a href="' . getUrl('action', ['action' => 'quickhelp', 'help' => 'membergroup_moderator']) . '" onclick="return reqOverlayDiv(this.href);" class="helpicon i-help"></a>)';
165 165
    							}
166
-          return $group_name;
167
-      },
166
+		  return $group_name;
167
+	  },
168 168
 					),
169 169
 					'sort' => array(
170 170
 						'default' => 'CASE WHEN mg.id_group < 4 THEN mg.id_group ELSE 4 END, mg.group_name',
@@ -177,15 +177,15 @@  discard block
 block discarded – undo
177 177
 					),
178 178
 					'data' => array(
179 179
 						'function' => static function ($rowData) {
180
-          global $settings;
181
-          if (empty($rowData['icons'][0])) {
182
-              return '';
183
-          }
184
-          if (empty($rowData['icons'][1])) {
185
-              return '';
186
-          }
187
-          return str_repeat('<img src="' . $settings['images_url'] . '/group_icons/' . $rowData['icons'][1] . '" alt="*" />', $rowData['icons'][0]);
188
-      },
180
+		  global $settings;
181
+		  if (empty($rowData['icons'][0])) {
182
+			  return '';
183
+		  }
184
+		  if (empty($rowData['icons'][1])) {
185
+			  return '';
186
+		  }
187
+		  return str_repeat('<img src="' . $settings['images_url'] . '/group_icons/' . $rowData['icons'][1] . '" alt="*" />', $rowData['icons'][0]);
188
+	  },
189 189
 					),
190 190
 					'sort' => array(
191 191
 						'default' => 'mg.icons',
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
 					),
199 199
 					'data' => array(
200 200
 						'function' => static function ($group) {
201
-          global $txt;
202
-          return empty($group['moderators']) ? '<em>' . $txt['membergroups_new_copy_none'] . '</em>' : implode(', ', $group['moderators']);
203
-      },
201
+		  global $txt;
202
+		  return empty($group['moderators']) ? '<em>' . $txt['membergroups_new_copy_none'] . '</em>' : implode(', ', $group['moderators']);
203
+	  },
204 204
 					),
205 205
 				),
206 206
 				'members' => array(
@@ -209,10 +209,10 @@  discard block
 block discarded – undo
209 209
 					),
210 210
 					'data' => array(
211 211
 						'function' => static function ($rowData) {
212
-          global $txt;
213
-          // No explicit members for the moderator group.
214
-          return $rowData['id_group'] == 3 ? $txt['membergroups_guests_na'] : comma_format($rowData['num_members']);
215
-      },
212
+		  global $txt;
213
+		  // No explicit members for the moderator group.
214
+		  return $rowData['id_group'] == 3 ? $txt['membergroups_guests_na'] : comma_format($rowData['num_members']);
215
+	  },
216 216
 						'class' => 'centertext',
217 217
 					),
218 218
 					'sort' => array(
@@ -294,10 +294,10 @@  discard block
 block discarded – undo
294 294
 				'name' => $name
295 295
 			);
296 296
    if ($this->user->id != $id_member) {
297
-       continue;
297
+	   continue;
298 298
    }
299 299
    if ($context['group']['group_type'] == 1) {
300
-       continue;
300
+	   continue;
301 301
    }
302 302
    $context['group']['can_moderate'] = true;
303 303
 		}
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 						'value' => $txt['name'],
144 144
 					),
145 145
 					'data' => array(
146
-						'function' => static function ($rowData) use ($base_type, $base_params) {
146
+						'function' => static function($rowData) use ($base_type, $base_params) {
147 147
           // Since the moderator group has no explicit members, no link is needed.
148 148
           if ($rowData['id_group'] == 3)
149 149
    							{
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 						'value' => $txt['membergroups_icons'],
177 177
 					),
178 178
 					'data' => array(
179
-						'function' => static function ($rowData) {
179
+						'function' => static function($rowData) {
180 180
           global $settings;
181 181
           if (empty($rowData['icons'][0])) {
182 182
               return '';
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 						'value' => $txt['moderators'],
198 198
 					),
199 199
 					'data' => array(
200
-						'function' => static function ($group) {
200
+						'function' => static function($group) {
201 201
           global $txt;
202 202
           return empty($group['moderators']) ? '<em>' . $txt['membergroups_new_copy_none'] . '</em>' : implode(', ', $group['moderators']);
203 203
       },
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 						'value' => $txt['membergroups_members_top'],
209 209
 					),
210 210
 					'data' => array(
211
-						'function' => static function ($rowData) {
211
+						'function' => static function($rowData) {
212 212
           global $txt;
213 213
           // No explicit members for the moderator group.
214 214
           return $rowData['id_group'] == 3 ? $txt['membergroups_guests_na'] : comma_format($rowData['num_members']);
Please login to merge, or discard this patch.
Braces   +10 added lines, -6 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 						'function' => static function ($rowData) use ($base_type, $base_params) {
147 147
           // Since the moderator group has no explicit members, no link is needed.
148 148
           if ($rowData['id_group'] == 3)
149
-   							{
149
+          {
150 150
    								$group_name = $rowData['group_name'];
151 151
    							}
152 152
    							else
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
    							}
157 157
           // Add a help option for moderator and administrator.
158 158
           if ($rowData['id_group'] == 1)
159
-   							{
159
+          {
160 160
    								$group_name .= ' (<a href="' . getUrl('action', ['action' => 'quickhelp', 'help' => 'membergroup_administrator']) . '" onclick="return reqOverlayDiv(this.href);" class="helpicon i-help"></a>)';
161 161
    							}
162 162
    							elseif ($rowData['id_group'] == 3)
@@ -178,10 +178,12 @@  discard block
 block discarded – undo
178 178
 					'data' => array(
179 179
 						'function' => static function ($rowData) {
180 180
           global $settings;
181
-          if (empty($rowData['icons'][0])) {
181
+          if (empty($rowData['icons'][0]))
182
+          {
182 183
               return '';
183 184
           }
184
-          if (empty($rowData['icons'][1])) {
185
+          if (empty($rowData['icons'][1]))
186
+          {
185 187
               return '';
186 188
           }
187 189
           return str_repeat('<img src="' . $settings['images_url'] . '/group_icons/' . $rowData['icons'][1] . '" alt="*" />', $rowData['icons'][0]);
@@ -293,10 +295,12 @@  discard block
 block discarded – undo
293 295
 				'id' => $id_member,
294 296
 				'name' => $name
295 297
 			);
296
-   if ($this->user->id != $id_member) {
298
+   if ($this->user->id != $id_member)
299
+   {
297 300
        continue;
298 301
    }
299
-   if ($context['group']['group_type'] == 1) {
302
+   if ($context['group']['group_type'] == 1)
303
+   {
300 304
        continue;
301 305
    }
302 306
    $context['group']['can_moderate'] = true;
Please login to merge, or discard this patch.
sources/ElkArte/Controller/Karma.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
 		// Delete any older items from the log so we can get the go ahead or not
114 114
 		clearKarma($modSettings['karmaWaitTime']);
115 115
   if (!empty($modSettings['karmaTimeRestrictAdmins']) || !allowedTo('moderate_forum')) {
116
-      return lastActionOn($this->user->id, $id_target);
116
+	  return lastActionOn($this->user->id, $id_target);
117 117
   }
118 118
 
119 119
 		return 0;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,8 @@
 block discarded – undo
112 112
 
113 113
 		// Delete any older items from the log so we can get the go ahead or not
114 114
 		clearKarma($modSettings['karmaWaitTime']);
115
-  if (!empty($modSettings['karmaTimeRestrictAdmins']) || !allowedTo('moderate_forum')) {
115
+  if (!empty($modSettings['karmaTimeRestrictAdmins']) || !allowedTo('moderate_forum'))
116
+  {
116 117
       return lastActionOn($this->user->id, $id_target);
117 118
   }
118 119
 
Please login to merge, or discard this patch.
sources/ElkArte/Controller/Mentions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 			'default_sort_dir' => 'default',
197 197
 			'no_items_label' => $this->_all ? $txt['no_mentions_yet'] : $txt['no_new_mentions'],
198 198
 			'get_items' => [
199
-				'function' => fn(int $start, int $limit, string $sort, bool $all, string $type): array => $this->list_loadMentions($start, $limit, $sort, $all, $type),
199
+				'function' => fn(int $start, int $limit, string $sort, bool $all, string $type) : array => $this->list_loadMentions($start, $limit, $sort, $all, $type),
200 200
 				'params' => [
201 201
 					$this->_all,
202 202
 					$this->_type,
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 						'value' => $txt['mentions_from'],
216 216
 					],
217 217
 					'data' => [
218
-						'function' => static function ($row) {
218
+						'function' => static function($row) {
219 219
 							global $settings;
220 220
 
221 221
 							if (isset($settings['mentions']['mentioner_template']))
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 						'class' => 'listaction grid8',
276 276
 					],
277 277
 					'data' => [
278
-						'function' => static function ($row) {
278
+						'function' => static function($row) {
279 279
 							global $txt;
280 280
 
281 281
 							$mark = empty($row['status']) ? 'read' : 'unread';
Please login to merge, or discard this patch.
sources/ElkArte/Controller/Xml.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -382,7 +382,7 @@
 block discarded – undo
382 382
 				$moved_key = 0;
383 383
 
384 384
 				// What board was drag and dropped?
385
-				[, $board_moved,] = explode(',', $this->_req->post->moved);
385
+				[, $board_moved, ] = explode(',', $this->_req->post->moved);
386 386
 				$board_moved = (int) $board_moved;
387 387
 
388 388
 				// The board ids arrive in 1-n view order ...
Please login to merge, or discard this patch.
sources/ElkArte/Controller/Post.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -555,7 +555,7 @@
 block discarded – undo
555 555
 				$case = 4;
556 556
 			}
557 557
 
558
-			[$this->_form_subject,] = getFormMsgSubject($case, $topic, $this->_topic_attributes['subject'], $msg_id);
558
+			[$this->_form_subject, ] = getFormMsgSubject($case, $topic, $this->_topic_attributes['subject'], $msg_id);
559 559
 		}
560 560
 
561 561
 		// No check is needed, since nothing is really posted.
Please login to merge, or discard this patch.
sources/ElkArte/Controller/ModerationCenter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 		if (!empty($options['admin_preferences']))
89 89
 		{
90
-			$context['admin_preferences'] = serializeToJson($options['admin_preferences'], static function ($array_form) {
90
+			$context['admin_preferences'] = serializeToJson($options['admin_preferences'], static function($array_form) {
91 91
 				global $context;
92 92
 
93 93
 				$context['admin_preferences'] = $array_form;
@@ -1148,7 +1148,7 @@  discard block
 block discarded – undo
1148 1148
 						'value' => $txt['mc_watched_users_last_post'],
1149 1149
 					),
1150 1150
 					'data' => array(
1151
-						'function' => static function ($member) {
1151
+						'function' => static function($member) {
1152 1152
 							if ($member['last_post_id'])
1153 1153
 							{
1154 1154
 								return '<a href="' . getUrl('action', ['msg' => $member['last_post_id']]) . '">' . $member['last_post'] . '</a>';
@@ -1388,7 +1388,7 @@  discard block
 block discarded – undo
1388 1388
 						'value' => $txt['profile_warning_previous_reason'],
1389 1389
 					),
1390 1390
 					'data' => array(
1391
-						'function' => static function ($warning) {
1391
+						'function' => static function($warning) {
1392 1392
 							global $txt;
1393 1393
 
1394 1394
 							$output = '
Please login to merge, or discard this patch.
sources/subs/Maillist.subs.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 			'id' => $id,
82 82
 		]
83 83
 	)->fetch_callback(
84
-		static function ($row) use (&$postemail, &$i) {
84
+		static function($row) use (&$postemail, &$i) {
85 85
 			global $txt, $boardurl;
86 86
 			$postemail[$i] = [
87 87
 				'id_email' => $row['id_email'],
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 			'style' => $style
230 230
 		]
231 231
 	)->fetch_callback(
232
-		static function ($row) use (&$email_filters) {
232
+		static function($row) use (&$email_filters) {
233 233
 			$email_filters[$row['id_filter']] = [
234 234
 				'id_filter' => $row['id_filter'],
235 235
 				'filter_type' => $row['filter_type'],
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 			'zero' => 0,
364 364
 		]
365 365
 	)->fetch_callback(
366
-		static function ($row) use (&$result) {
366
+		static function($row) use (&$result) {
367 367
 			$result[$row['id_board']] = $row['name'];
368 368
 		}
369 369
 	);
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 			'current_member' => User::$info->id,
421 421
 		]
422 422
 	)->fetch_callback(
423
-		static function ($row) use ($subject) {
423
+		static function($row) use ($subject) {
424 424
 			$template = [
425 425
 				'title' => $row['template_title'],
426 426
 				'body' => $row['body'],
Please login to merge, or discard this patch.