Passed
Pull Request — release-2.1 (#6097)
by Mathias
10:40
created
Sources/tasks/CreatePost-Notify.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 {
20 20
 	/**
21 21
 	 * Constants for reply types.
22
-	*/
22
+	 */
23 23
 	const NOTIFY_TYPE_REPLY_AND_MODIFY = 1;
24 24
 	const NOTIFY_TYPE_REPLY_AND_TOPIC_START_FOLLOWING = 2;
25 25
 	const NOTIFY_TYPE_ONLY_REPLIES = 3;
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 	/**
29 29
 	 * Constants for frequencies.
30
-	*/
30
+	 */
31 31
 	const FREQUENCY_NOTHING = 0;
32 32
 	const FREQUENCY_EVERYTHING = 1;
33 33
 	const FREQUENCY_FIRST_UNREAD_MSG = 2;
Please login to merge, or discard this patch.
Braces   -1 removed lines patch added patch discarded remove patch
@@ -266,7 +266,6 @@
 block discarded – undo
266 266
 				$user_info = $real_user_info;
267 267
 				unset($real_user_info);
268 268
 			}
269
-
270 269
 			else
271 270
 				$user_info = null;
272 271
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 		if ($type == 'edit')
119 119
 		{
120 120
 			// Filter out members who have already been notified about this post's topic
121
-			$unnotified = array_filter($watched, function ($member)
121
+			$unnotified = array_filter($watched, function($member)
122 122
 			{
123 123
 				return empty($member['sent']);
124 124
 			});
@@ -204,8 +204,7 @@  discard block
 block discarded – undo
204 204
 			if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($prefs[$member_id]))
205 205
 			{
206 206
 				$pref = !empty($prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ?
207
-					$prefs[$member_id]['topic_notify_' . $topicOptions['id']] :
208
-					(!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0);
207
+					$prefs[$member_id]['topic_notify_' . $topicOptions['id']] : (!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0);
209 208
 
210 209
 				$message_type = 'notification_' . $type;
211 210
 
@@ -224,8 +223,7 @@  discard block
 block discarded – undo
224 223
 			elseif ($type == 'topic')
225 224
 			{
226 225
 				$pref = !empty($prefs[$member_id]['board_notify_' . $topicOptions['board']]) ?
227
-					$prefs[$member_id]['board_notify_' . $topicOptions['board']] :
228
-					(!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0);
226
+					$prefs[$member_id]['board_notify_' . $topicOptions['board']] : (!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0);
229 227
 
230 228
 				$content_type = 'board';
231 229
 
Please login to merge, or discard this patch.
Sources/Load.php 1 patch
Braces   +1 added lines, -8 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	// Set a list of common functions.
105 105
 	$ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);';
106 106
 	$ent_check = empty($modSettings['disableEntityCheck']) ? function($string)
107
-		{
107
+	{
108 108
 			$string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string);
109 109
 			return $string;
110 110
 		} : function($string)
@@ -925,7 +925,6 @@  discard block
 block discarded – undo
925 925
 			$user_settings_min[$row['id_member']]['time_offset'] = ($tz_user->getOffset($time_user) -
926 926
 					$tz_system->getOffset($time_system)) / 3600;
927 927
 		}
928
-
929 928
 		else
930 929
 			$user_settings_min[$row['id_member']]['time_offset'] = empty($row['time_offset']) ? 0 : $row['time_offset'];
931 930
 	}
@@ -1655,7 +1654,6 @@  discard block
 block discarded – undo
1655 1654
 			$time_user = new DateTime('now', $tz_user);
1656 1655
 			$profile['time_offset'] = ($tz_user->getOffset($time_user) - $tz_system->getOffset($time_system)) / 3600;
1657 1656
 		}
1658
-
1659 1657
 		else
1660 1658
 		{
1661 1659
 			// !!! Compatibility.
@@ -2318,7 +2316,6 @@  discard block
 block discarded – undo
2318 2316
 		loadLanguage('index+Modifications');
2319 2317
 		$context['template_layers'] = array();
2320 2318
 	}
2321
-
2322 2319
 	else
2323 2320
 	{
2324 2321
 		// Custom templates to load, or just default?
@@ -2699,14 +2696,12 @@  discard block
 block discarded – undo
2699 2696
 				$fileUrl = $settings['default_theme_url'] . '/css/' . $fileName;
2700 2697
 				$filePath = $settings['default_theme_dir'] . '/css/' . $fileName;
2701 2698
 			}
2702
-
2703 2699
 			else
2704 2700
 			{
2705 2701
 				$fileUrl = false;
2706 2702
 				$filePath = false;
2707 2703
 			}
2708 2704
 		}
2709
-
2710 2705
 		else
2711 2706
 		{
2712 2707
 			$fileUrl = $settings[$themeRef . '_url'] . '/css/' . $fileName;
@@ -2814,14 +2809,12 @@  discard block
 block discarded – undo
2814 2809
 				$fileUrl = $settings['default_theme_url'] . '/scripts/' . $fileName;
2815 2810
 				$filePath = $settings['default_theme_dir'] . '/scripts/' . $fileName;
2816 2811
 			}
2817
-
2818 2812
 			else
2819 2813
 			{
2820 2814
 				$fileUrl = false;
2821 2815
 				$filePath = false;
2822 2816
 			}
2823 2817
 		}
2824
-
2825 2818
 		else
2826 2819
 		{
2827 2820
 			$fileUrl = $settings[$themeRef . '_url'] . '/scripts/' . $fileName;
Please login to merge, or discard this patch.
Sources/tasks/ExportProfileData.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
 
120 120
 		$feed_meta = array(
121 121
 			'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']),
122
-			'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))),
122
+			'desc' => sentence_list(array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))),
123 123
 			'author' => $mbname,
124 124
 			'source' => $scripturl . '?action=profile;u=' . $uid,
125 125
 			'self' => $scripturl . '?action=profile;area=download;u=' . $uid . ';t=' . hash_hmac('sha1', $idhash, get_auth_secret()),
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,9 @@
 block discarded – undo
119 119
 
120 120
 		$feed_meta = array(
121 121
 			'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']),
122
-			'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))),
122
+			'desc' => sentence_list(array_map(function ($datatype) use ($txt)
123
+			{
124
+return $txt[$datatype]; }, array_keys($included))),
123 125
 			'author' => $mbname,
124 126
 			'source' => $scripturl . '?action=profile;u=' . $uid,
125 127
 			'self' => $scripturl . '?action=profile;area=download;u=' . $uid . ';t=' . hash_hmac('sha1', $idhash, get_auth_secret()),
Please login to merge, or discard this patch.
Sources/ManageErrors.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -355,8 +355,8 @@
 block discarded – undo
355 355
 	elseif (isset($_POST['delall']) && isset($filter))
356 356
 	{
357 357
 		// ip need a different placeholder type
358
-		$filter_type = $filter['variable'] == 'ip'? 'inet' : 'string';
359
-		$filter_op = $filter['variable'] == 'ip'? '=' : 'LIKE';
358
+		$filter_type = $filter['variable'] == 'ip' ? 'inet' : 'string';
359
+		$filter_op = $filter['variable'] == 'ip' ? '=' : 'LIKE';
360 360
 		$smcFunc['db_query']('', '
361 361
 			DELETE FROM {db_prefix}log_errors
362 362
 			WHERE ' . $filter['variable'] . ' ' . $filter_op . ' {' . $filter_type . ':filter}',
Please login to merge, or discard this patch.
Sources/Profile-Actions.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1396,7 +1396,7 @@
 block discarded – undo
1396 1396
 
1397 1397
 	// Figure out the filename we'll tell the browser.
1398 1398
 	$datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile');
1399
-	$included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes);
1399
+	$included_desc = array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes);
1400 1400
 
1401 1401
 	$dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc);
1402 1402
 	$dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename)))));
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1396,7 +1396,9 @@
 block discarded – undo
1396 1396
 
1397 1397
 	// Figure out the filename we'll tell the browser.
1398 1398
 	$datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile');
1399
-	$included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes);
1399
+	$included_desc = array_map(function ($datatype) use ($txt)
1400
+	{
1401
+return $txt[$datatype]; }, $datatypes);
1400 1402
 
1401 1403
 	$dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc);
1402 1404
 	$dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename)))));
Please login to merge, or discard this patch.
Tests/installTest.php 4 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -20,56 +20,56 @@
 block discarded – undo
20 20
 
21 21
 final class InstallTest extends TestCase
22 22
 {
23
-    public function testWrite() {
24
-        load_lang_file();
25
-        $var = CheckFilesWritable();
26
-        $this->assertEquals(true,$var);
27
-    }
23
+	public function testWrite() {
24
+		load_lang_file();
25
+		$var = CheckFilesWritable();
26
+		$this->assertEquals(true,$var);
27
+	}
28 28
 
29
-    public function testDBSettings() {
30
-        $_POST['db_type'] = 'postgresql';
31
-        $_POST['db_prefix'] = 'smf_';
32
-        $_POST['db_name'] = 'postgres';
33
-        $_POST['db_user'] = 'postgres';
34
-        $_POST['db_passwd'] = '';
35
-        $_POST['db_server'] = 'localhost';
36
-        $_POST['db_port'] = '5432';
29
+	public function testDBSettings() {
30
+		$_POST['db_type'] = 'postgresql';
31
+		$_POST['db_prefix'] = 'smf_';
32
+		$_POST['db_name'] = 'postgres';
33
+		$_POST['db_user'] = 'postgres';
34
+		$_POST['db_passwd'] = '';
35
+		$_POST['db_server'] = 'localhost';
36
+		$_POST['db_port'] = '5432';
37 37
 
38
-        // updateSettingsFile got different way to detect setting dir...
39
-        $GLOBALS['boarddir'] = getcwd();
38
+		// updateSettingsFile got different way to detect setting dir...
39
+		$GLOBALS['boarddir'] = getcwd();
40 40
 
41
-        load_lang_file();
42
-        $var = DatabaseSettings();
43
-        $this->assertEquals(true,$var);
44
-    }
41
+		load_lang_file();
42
+		$var = DatabaseSettings();
43
+		$this->assertEquals(true,$var);
44
+	}
45 45
 
46
-    public function testForumSettings() {
47
-        $_SERVER['SERVER_NAME'] = 'localhost';
48
-        $_POST['boardurl'] = 'http://localhost';
49
-        $_POST['mbname'] = 'My PHPUnit Community';
50
-        load_lang_file();
51
-        $var = ForumSettings();
52
-        $this->assertEquals(true,$var);
53
-    }
46
+	public function testForumSettings() {
47
+		$_SERVER['SERVER_NAME'] = 'localhost';
48
+		$_POST['boardurl'] = 'http://localhost';
49
+		$_POST['mbname'] = 'My PHPUnit Community';
50
+		load_lang_file();
51
+		$var = ForumSettings();
52
+		$this->assertEquals(true,$var);
53
+	}
54 54
 
55
-    public function testDatabasePopulation() {
56
-        load_lang_file();
57
-        $var = DatabasePopulation();
58
-        $this->assertEquals(true,$var);
59
-    }
55
+	public function testDatabasePopulation() {
56
+		load_lang_file();
57
+		$var = DatabasePopulation();
58
+		$this->assertEquals(true,$var);
59
+	}
60 60
 
61
-    public function testAdminAccount() {
62
-        $_POST['username'] = 'Admin';
63
-        $_POST['email'] = '[email protected]';
64
-        $_POST['password1'] = 'admin';    
65
-        $_POST['contbutt'] = '1234';
61
+	public function testAdminAccount() {
62
+		$_POST['username'] = 'Admin';
63
+		$_POST['email'] = '[email protected]';
64
+		$_POST['password1'] = 'admin';    
65
+		$_POST['contbutt'] = '1234';
66 66
 
67
-        $_POST['password2'] = $_POST['password1'];
68
-        $_POST['server_email'] = $_POST['email'];
69
-        load_lang_file();
70
-        $var = AdminAccount();
71
-        $this->assertEquals(true,$var);
72
-    }
67
+		$_POST['password2'] = $_POST['password1'];
68
+		$_POST['server_email'] = $_POST['email'];
69
+		load_lang_file();
70
+		$var = AdminAccount();
71
+		$this->assertEquals(true,$var);
72
+	}
73 73
 }
74 74
 
75 75
 ?>
76 76
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * @version 2.1 RC2
15 15
  */
16 16
 
17
-define('SMFPHPUNIT',TRUE);
17
+define('SMFPHPUNIT', TRUE);
18 18
 use PHPUnit\Framework\TestCase;
19 19
 require_once('./install.php');
20 20
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     public function testWrite() {
24 24
         load_lang_file();
25 25
         $var = CheckFilesWritable();
26
-        $this->assertEquals(true,$var);
26
+        $this->assertEquals(true, $var);
27 27
     }
28 28
 
29 29
     public function testDBSettings() {
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
         load_lang_file();
42 42
         $var = DatabaseSettings();
43
-        $this->assertEquals(true,$var);
43
+        $this->assertEquals(true, $var);
44 44
     }
45 45
 
46 46
     public function testForumSettings() {
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
         $_POST['mbname'] = 'My PHPUnit Community';
50 50
         load_lang_file();
51 51
         $var = ForumSettings();
52
-        $this->assertEquals(true,$var);
52
+        $this->assertEquals(true, $var);
53 53
     }
54 54
 
55 55
     public function testDatabasePopulation() {
56 56
         load_lang_file();
57 57
         $var = DatabasePopulation();
58
-        $this->assertEquals(true,$var);
58
+        $this->assertEquals(true, $var);
59 59
     }
60 60
 
61 61
     public function testAdminAccount() {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $_POST['server_email'] = $_POST['email'];
69 69
         load_lang_file();
70 70
         $var = AdminAccount();
71
-        $this->assertEquals(true,$var);
71
+        $this->assertEquals(true, $var);
72 72
     }
73 73
 }
74 74
 
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,13 +20,15 @@  discard block
 block discarded – undo
20 20
 
21 21
 final class InstallTest extends TestCase
22 22
 {
23
-    public function testWrite() {
23
+    public function testWrite()
24
+    {
24 25
         load_lang_file();
25 26
         $var = CheckFilesWritable();
26 27
         $this->assertEquals(true,$var);
27 28
     }
28 29
 
29
-    public function testDBSettings() {
30
+    public function testDBSettings()
31
+    {
30 32
         $_POST['db_type'] = 'postgresql';
31 33
         $_POST['db_prefix'] = 'smf_';
32 34
         $_POST['db_name'] = 'postgres';
@@ -43,7 +45,8 @@  discard block
 block discarded – undo
43 45
         $this->assertEquals(true,$var);
44 46
     }
45 47
 
46
-    public function testForumSettings() {
48
+    public function testForumSettings()
49
+    {
47 50
         $_SERVER['SERVER_NAME'] = 'localhost';
48 51
         $_POST['boardurl'] = 'http://localhost';
49 52
         $_POST['mbname'] = 'My PHPUnit Community';
@@ -52,13 +55,15 @@  discard block
 block discarded – undo
52 55
         $this->assertEquals(true,$var);
53 56
     }
54 57
 
55
-    public function testDatabasePopulation() {
58
+    public function testDatabasePopulation()
59
+    {
56 60
         load_lang_file();
57 61
         $var = DatabasePopulation();
58 62
         $this->assertEquals(true,$var);
59 63
     }
60 64
 
61
-    public function testAdminAccount() {
65
+    public function testAdminAccount()
66
+    {
62 67
         $_POST['username'] = 'Admin';
63 68
         $_POST['email'] = '[email protected]';
64 69
         $_POST['password1'] = 'admin';    
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
  * @version 2.1 RC2
15 15
  */
16 16
 
17
-define('SMFPHPUNIT',TRUE);
17
+define('SMFPHPUNIT',true);
18 18
 use PHPUnit\Framework\TestCase;
19 19
 require_once('./install.php');
20 20
 
Please login to merge, or discard this patch.