Completed
Push — master ( 760553...dce43d )
by J.D.
03:49
created
src/components/ranks/includes/class-wordpoints-rank-types.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	 *
36 36
 	 * @return bool Whether this rank type is registered.
37 37
 	 */
38
-	public static function is_type_registered( $type ) {
38
+	public static function is_type_registered($type) {
39 39
 
40
-		return isset( self::$types[ $type ] );
40
+		return isset(self::$types[$type]);
41 41
 	}
42 42
 
43 43
 	/**
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
 	 *
55 55
 	 * @return bool Whether the rank type was registered.
56 56
 	 */
57
-	public static function register_type( $type, $class, array $args = array() ) {
57
+	public static function register_type($type, $class, array $args = array()) {
58 58
 
59
-		if ( self::is_type_registered( $type ) ) {
59
+		if (self::is_type_registered($type)) {
60 60
 			return false;
61 61
 		}
62 62
 
63 63
 		$args['slug'] = $type;
64 64
 
65
-		self::$types[ $type ] = new $class( $args );
65
+		self::$types[$type] = new $class($args);
66 66
 
67 67
 		return true;
68 68
 	}
@@ -78,23 +78,23 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @return bool Whether the rank type was deregistered.
80 80
 	 */
81
-	public static function deregister_type( $type ) {
81
+	public static function deregister_type($type) {
82 82
 
83
-		if ( 'base' === $type ) {
83
+		if ('base' === $type) {
84 84
 			return false;
85 85
 		}
86 86
 
87
-		if ( ! self::is_type_registered( $type ) ) {
87
+		if ( ! self::is_type_registered($type)) {
88 88
 			return false;
89 89
 		}
90 90
 
91
-		self::$types[ $type ]->destruct();
91
+		self::$types[$type]->destruct();
92 92
 
93
-		foreach ( WordPoints_Rank_Groups::get() as $group ) {
94
-			$group->remove_type( $type );
93
+		foreach (WordPoints_Rank_Groups::get() as $group) {
94
+			$group->remove_type($type);
95 95
 		}
96 96
 
97
-		unset( self::$types[ $type ] );
97
+		unset(self::$types[$type]);
98 98
 
99 99
 		return true;
100 100
 	}
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 */
109 109
 	public static function get() {
110 110
 
111
-		if ( ! did_action( 'wordpoints_ranks_register' ) ) {
111
+		if ( ! did_action('wordpoints_ranks_register')) {
112 112
 			_doing_it_wrong(
113 113
 				__METHOD__
114 114
 				, 'Ranks should not be retrieved until after they are all registered.'
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 	 *
129 129
 	 * @return WordPoints_Rank_Type|false The handler object, or false.
130 130
 	 */
131
-	public static function get_type( $type ) {
131
+	public static function get_type($type) {
132 132
 
133
-		if ( ! self::is_type_registered( $type ) ) {
133
+		if ( ! self::is_type_registered($type)) {
134 134
 			return false;
135 135
 		}
136 136
 
137
-		return self::$types[ $type ];
137
+		return self::$types[$type];
138 138
 	}
139 139
 
140 140
 	/**
@@ -146,21 +146,21 @@  discard block
 block discarded – undo
146 146
 	 */
147 147
 	public static function init() {
148 148
 
149
-		self::register_type( 'base', 'WordPoints_Base_Rank_Type' );
149
+		self::register_type('base', 'WordPoints_Base_Rank_Type');
150 150
 
151 151
 		/**
152 152
 		 * Ranks should not register later than this action.
153 153
 		 *
154 154
 		 * @since 1.7.0
155 155
 		 */
156
-		do_action( 'wordpoints_ranks_register' );
156
+		do_action('wordpoints_ranks_register');
157 157
 
158 158
 		/**
159 159
 		 * All ranks are registered.
160 160
 		 *
161 161
 		 * @since 1.7.0
162 162
 		 */
163
-		do_action( 'wordpoints_ranks_registered' );
163
+		do_action('wordpoints_ranks_registered');
164 164
 	}
165 165
 }
166 166
 
Please login to merge, or discard this patch.
src/components/ranks/admin/admin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,20 +12,20 @@
 block discarded – undo
12 12
  *
13 13
  * @since 1.7.0
14 14
  */
15
-include_once( WORDPOINTS_DIR . 'components/ranks/admin/includes/ajax.php' );
15
+include_once(WORDPOINTS_DIR . 'components/ranks/admin/includes/ajax.php');
16 16
 
17 17
 /**
18 18
  * Admin-side functions of the ranks component.
19 19
  *
20 20
  * @since 2.1.0
21 21
  */
22
-include_once( WORDPOINTS_DIR . 'components/ranks/admin/includes/functions.php' );
22
+include_once(WORDPOINTS_DIR . 'components/ranks/admin/includes/functions.php');
23 23
 
24 24
 /**
25 25
  * Admin-side action and filter hooks of the ranks component.
26 26
  *
27 27
  * @since 2.1.0
28 28
  */
29
-include_once( WORDPOINTS_DIR . 'components/ranks/admin/includes/filters.php' );
29
+include_once(WORDPOINTS_DIR . 'components/ranks/admin/includes/filters.php');
30 30
 
31 31
 // EOF
Please login to merge, or discard this patch.
src/components/ranks/classes/rank/shortcode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@
 block discarded – undo
19 19
 	 */
20 20
 	protected function verify_atts() {
21 21
 
22
-		if ( isset( $this->pairs['rank_group'] ) && empty( $this->atts['rank_group'] ) ) {
22
+		if (isset($this->pairs['rank_group']) && empty($this->atts['rank_group'])) {
23 23
 
24 24
 			return sprintf(
25 25
 				// translators: 1. Attribute name; 2. Shortcode name.
26
-				__( 'The “%1$s” attribute of the %2$s shortcode must be a rank group slug.', 'wordpoints' )
26
+				__('The “%1$s” attribute of the %2$s shortcode must be a rank group slug.', 'wordpoints')
27 27
 				,'rank_group'
28 28
 				, "<code>[{$this->shortcode}]</code>"
29 29
 			);
Please login to merge, or discard this patch.
src/classes/breaking/updater.php 1 patch
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 	 * @since 2.0.0
24 24
 	 */
25 25
 	protected $updates = array(
26
-		'breaking'  => array( 'single' => true, 'site' => true, 'network' => true ),
26
+		'breaking'  => array('single' => true, 'site' => true, 'network' => true),
27 27
 	);
28 28
 
29 29
 	/**
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
 		 *
46 46
 		 * @since 2.0.0
47 47
 		 */
48
-		require_once( ABSPATH . 'wp-admin/includes/file.php' );
48
+		require_once(ABSPATH . 'wp-admin/includes/file.php');
49 49
 
50
-		if ( ! WP_Filesystem( false, ABSPATH ) ) {
50
+		if ( ! WP_Filesystem(false, ABSPATH)) {
51 51
 			return;
52 52
 		}
53 53
 
@@ -59,18 +59,18 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	protected function after_update() {
61 61
 
62
-		$this->maintenance_mode( false );
62
+		$this->maintenance_mode(false);
63 63
 
64
-		if ( $this->network_wide ) {
64
+		if ($this->network_wide) {
65 65
 
66 66
 			$deactivated_modules = array_diff(
67 67
 				$this->checked_modules
68
-				, array_filter( $this->checked_modules )
68
+				, array_filter($this->checked_modules)
69 69
 			);
70 70
 
71 71
 			update_site_option(
72 72
 				'wordpoints_breaking_deactivated_modules'
73
-				, array_keys( $deactivated_modules )
73
+				, array_keys($deactivated_modules)
74 74
 			);
75 75
 		}
76 76
 	}
@@ -89,27 +89,27 @@  discard block
 block discarded – undo
89 89
 	 *
90 90
 	 * @param bool $enable Whether to turn maintenance mode on or off.
91 91
 	 */
92
-	protected function maintenance_mode( $enable = true ) {
92
+	protected function maintenance_mode($enable = true) {
93 93
 
94 94
 		/**
95 95
 		 * @var WP_Filesystem_Base $wp_filesystem
96 96
 		 */
97 97
 		global $wp_filesystem;
98 98
 
99
-		if ( ! ( $wp_filesystem instanceof WP_Filesystem_Base ) ) {
99
+		if ( ! ($wp_filesystem instanceof WP_Filesystem_Base)) {
100 100
 			return;
101 101
 		}
102 102
 
103 103
 		$file = $wp_filesystem->abspath() . '.maintenance';
104 104
 
105
-		if ( $enable ) {
105
+		if ($enable) {
106 106
 
107 107
 			$maintenance_string = '<?php $upgrading = ' . time() . '; include( "' . WORDPOINTS_DIR . '/includes/maintenance.php" ); ?>';
108
-			$wp_filesystem->delete( $file );
109
-			$wp_filesystem->put_contents( $file, $maintenance_string, FS_CHMOD_FILE );
108
+			$wp_filesystem->delete($file);
109
+			$wp_filesystem->put_contents($file, $maintenance_string, FS_CHMOD_FILE);
110 110
 
111
-		} elseif ( $wp_filesystem->exists( $file ) ) {
112
-			$wp_filesystem->delete( $file );
111
+		} elseif ($wp_filesystem->exists($file)) {
112
+			$wp_filesystem->delete($file);
113 113
 		}
114 114
 	}
115 115
 
@@ -120,15 +120,15 @@  discard block
 block discarded – undo
120 120
 	 */
121 121
 	protected function update_network_to_breaking() {
122 122
 
123
-		if ( ! $this->network_wide ) {
123
+		if ( ! $this->network_wide) {
124 124
 			return;
125 125
 		}
126 126
 
127 127
 		$network_active_modules = array_keys(
128
-			wordpoints_get_array_option( 'wordpoints_sitewide_active_modules', 'site' )
128
+			wordpoints_get_array_option('wordpoints_sitewide_active_modules', 'site')
129 129
 		);
130 130
 
131
-		$this->check_modules( $network_active_modules );
131
+		$this->check_modules($network_active_modules);
132 132
 	}
133 133
 
134 134
 	/**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	protected function update_single_to_breaking() {
149 149
 
150 150
 		$this->check_modules(
151
-			wordpoints_get_array_option( 'wordpoints_active_modules' )
151
+			wordpoints_get_array_option('wordpoints_active_modules')
152 152
 		);
153 153
 	}
154 154
 
@@ -159,17 +159,17 @@  discard block
 block discarded – undo
159 159
 	 *
160 160
 	 * @param array $modules A list of basename-paths of modules to check.
161 161
 	 */
162
-	protected function check_modules( $modules ) {
162
+	protected function check_modules($modules) {
163 163
 
164
-		$modules = $this->validate_modules( $modules );
164
+		$modules = $this->validate_modules($modules);
165 165
 
166
-		if ( empty( $modules ) ) {
166
+		if (empty($modules)) {
167 167
 			return;
168 168
 		}
169 169
 
170 170
 		// First try checking all of them at once.
171
-		if ( count( $modules ) > 1 ) {
172
-			if ( $this->check_module( implode( ',', $modules ) ) ) {
171
+		if (count($modules) > 1) {
172
+			if ($this->check_module(implode(',', $modules))) {
173 173
 				return;
174 174
 			}
175 175
 		}
@@ -177,18 +177,18 @@  discard block
 block discarded – undo
177 177
 		// If there was one or more broken, we'll have to check each to find them.
178 178
 		$incompatible_modules = array();
179 179
 
180
-		foreach ( $modules as $module ) {
181
-			if ( ! $this->check_module( $module ) ) {
180
+		foreach ($modules as $module) {
181
+			if ( ! $this->check_module($module)) {
182 182
 				$incompatible_modules[] = $module;
183
-				$this->checked_modules[ $module ] = false;
183
+				$this->checked_modules[$module] = false;
184 184
 			}
185 185
 		}
186 186
 
187
-		if ( empty( $incompatible_modules ) ) {
187
+		if (empty($incompatible_modules)) {
188 188
 			return;
189 189
 		}
190 190
 
191
-		$this->deactivate_modules( $incompatible_modules );
191
+		$this->deactivate_modules($incompatible_modules);
192 192
 	}
193 193
 
194 194
 	/**
@@ -200,32 +200,32 @@  discard block
 block discarded – undo
200 200
 	 *
201 201
 	 * @return string[] The valid modules.
202 202
 	 */
203
-	protected function validate_modules( $modules ) {
203
+	protected function validate_modules($modules) {
204 204
 
205 205
 		$incompatible = array();
206 206
 
207
-		foreach ( $modules as $index => $module ) {
207
+		foreach ($modules as $index => $module) {
208 208
 
209
-			if ( isset( $this->checked_modules[ $module ] ) ) {
209
+			if (isset($this->checked_modules[$module])) {
210 210
 
211
-				unset( $modules[ $index ] );
211
+				unset($modules[$index]);
212 212
 
213
-				if ( ! $this->checked_modules[ $module ] ) {
213
+				if ( ! $this->checked_modules[$module]) {
214 214
 					$incompatible[] = $module;
215 215
 				}
216 216
 			}
217 217
 
218
-			$valid = wordpoints_validate_module( $module );
218
+			$valid = wordpoints_validate_module($module);
219 219
 
220
-			if ( is_wp_error( $valid ) ) {
221
-				unset( $modules[ $index ] );
220
+			if (is_wp_error($valid)) {
221
+				unset($modules[$index]);
222 222
 			}
223 223
 
224
-			$this->checked_modules[ $module ] = true;
224
+			$this->checked_modules[$module] = true;
225 225
 		}
226 226
 
227
-		if ( ! empty( $incompatible ) ) {
228
-			$this->deactivate_modules( $incompatible );
227
+		if ( ! empty($incompatible)) {
228
+			$this->deactivate_modules($incompatible);
229 229
 		}
230 230
 
231 231
 		return $modules;
@@ -241,43 +241,43 @@  discard block
 block discarded – undo
241 241
 	 * @return bool|WP_Error Whether the page loaded correctly, or a WP_Error if
242 242
 	 *                       unable to make the request.
243 243
 	 */
244
-	protected function check_module( $module ) {
244
+	protected function check_module($module) {
245 245
 
246
-		$rand_str = wp_generate_password( 256, true, true );
247
-		$nonce = wordpoints_hash( $rand_str . 'wordpoints_check_modules-' . $module );
246
+		$rand_str = wp_generate_password(256, true, true);
247
+		$nonce = wordpoints_hash($rand_str . 'wordpoints_check_modules-' . $module);
248 248
 
249
-		if ( 'network' === $this->context ) {
250
-			update_site_option( 'wordpoints_module_check_rand_str', $rand_str );
251
-			update_site_option( 'wordpoints_module_check_nonce', $nonce );
249
+		if ('network' === $this->context) {
250
+			update_site_option('wordpoints_module_check_rand_str', $rand_str);
251
+			update_site_option('wordpoints_module_check_nonce', $nonce);
252 252
 		} else {
253
-			update_option( 'wordpoints_module_check_rand_str', $rand_str );
254
-			update_option( 'wordpoints_module_check_nonce', $nonce );
253
+			update_option('wordpoints_module_check_rand_str', $rand_str);
254
+			update_option('wordpoints_module_check_nonce', $nonce);
255 255
 		}
256 256
 
257 257
 		$response = wp_safe_remote_post(
258 258
 			add_query_arg(
259 259
 				'wordpoints_module_check'
260 260
 				, $nonce
261
-				, self_admin_url( 'admin-ajax.php?action=wordpoints_breaking_module_check&check_module=' . $module )
261
+				, self_admin_url('admin-ajax.php?action=wordpoints_breaking_module_check&check_module=' . $module)
262 262
 			)
263
-			, array( 'timeout' => 20 )
263
+			, array('timeout' => 20)
264 264
 		);
265 265
 
266
-		if ( 'network' === $this->context ) {
267
-			delete_site_option( 'wordpoints_module_check_rand_str' );
268
-			delete_site_option( 'wordpoints_module_check_nonce' );
266
+		if ('network' === $this->context) {
267
+			delete_site_option('wordpoints_module_check_rand_str');
268
+			delete_site_option('wordpoints_module_check_nonce');
269 269
 		} else {
270
-			delete_option( 'wordpoints_module_check_rand_str' );
271
-			delete_option( 'wordpoints_module_check_nonce' );
270
+			delete_option('wordpoints_module_check_rand_str');
271
+			delete_option('wordpoints_module_check_nonce');
272 272
 		}
273 273
 
274
-		if ( is_wp_error( $response ) ) {
274
+		if (is_wp_error($response)) {
275 275
 			return $response;
276 276
 		}
277 277
 
278
-		$body = wp_remote_retrieve_body( $response );
278
+		$body = wp_remote_retrieve_body($response);
279 279
 
280
-		return (bool) strpos( $body, $rand_str );
280
+		return (bool) strpos($body, $rand_str);
281 281
 	}
282 282
 
283 283
 	/**
@@ -287,23 +287,23 @@  discard block
 block discarded – undo
287 287
 	 *
288 288
 	 * @param array $modules A list of basename-paths of modules to deactivate.
289 289
 	 */
290
-	protected function deactivate_modules( $modules ) {
290
+	protected function deactivate_modules($modules) {
291 291
 
292
-		if ( 'network' === $this->context ) {
292
+		if ('network' === $this->context) {
293 293
 
294
-			$active_modules = wordpoints_get_array_option( 'wordpoints_sitewide_active_modules', 'site' );
295
-			$active_modules = array_diff_key( $active_modules, array_flip( $modules ) );
296
-			update_site_option( 'wordpoints_sitewide_active_modules', $active_modules );
294
+			$active_modules = wordpoints_get_array_option('wordpoints_sitewide_active_modules', 'site');
295
+			$active_modules = array_diff_key($active_modules, array_flip($modules));
296
+			update_site_option('wordpoints_sitewide_active_modules', $active_modules);
297 297
 
298
-			update_site_option( 'wordpoints_incompatible_modules', $modules );
298
+			update_site_option('wordpoints_incompatible_modules', $modules);
299 299
 
300 300
 		} else {
301 301
 
302
-			$active_modules = wordpoints_get_array_option( 'wordpoints_active_modules' );
303
-			$active_modules = array_diff( $active_modules, $modules );
304
-			update_option( 'wordpoints_active_modules', $active_modules );
302
+			$active_modules = wordpoints_get_array_option('wordpoints_active_modules');
303
+			$active_modules = array_diff($active_modules, $modules);
304
+			update_option('wordpoints_active_modules', $active_modules);
305 305
 
306
-			update_option( 'wordpoints_incompatible_modules', $modules );
306
+			update_option('wordpoints_incompatible_modules', $modules);
307 307
 		}
308 308
 	}
309 309
 }
Please login to merge, or discard this patch.
src/classes/installables.php 1 patch
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -84,13 +84,13 @@  discard block
 block discarded – undo
84 84
 	 *
85 85
 	 * @return bool True, or false if the installable has already been registered.
86 86
 	 */
87
-	public static function register( $type, $slug, $data ) {
87
+	public static function register($type, $slug, $data) {
88 88
 
89
-		if ( isset( self::$registered[ $type ][ $slug ] ) ) {
89
+		if (isset(self::$registered[$type][$slug])) {
90 90
 			return false;
91 91
 		}
92 92
 
93
-		self::$registered[ $type ][ $slug ] = $data;
93
+		self::$registered[$type][$slug] = $data;
94 94
 
95 95
 		return true;
96 96
 	}
@@ -106,19 +106,19 @@  discard block
 block discarded – undo
106 106
 	 *
107 107
 	 * @return WordPoints_Un_Installer_Base|false Whether the module was installed.
108 108
 	 */
109
-	public static function install( $type, $slug, $network_wide = false ) {
109
+	public static function install($type, $slug, $network_wide = false) {
110 110
 
111
-		if ( ! isset( self::$registered[ $type ][ $slug ] ) ) {
111
+		if ( ! isset(self::$registered[$type][$slug])) {
112 112
 			return false;
113 113
 		}
114 114
 
115
-		$installer = self::get_installer( $type, $slug );
115
+		$installer = self::get_installer($type, $slug);
116 116
 
117
-		if ( ! $installer ) {
117
+		if ( ! $installer) {
118 118
 			return false;
119 119
 		}
120 120
 
121
-		$installer->install( $network_wide );
121
+		$installer->install($network_wide);
122 122
 
123 123
 		return $installer;
124 124
 	}
@@ -133,15 +133,15 @@  discard block
 block discarded – undo
133 133
 	 *
134 134
 	 * @return WordPoints_Un_Installer_Base|false Whether the module was uninstalled.
135 135
 	 */
136
-	public static function uninstall( $type, $slug ) {
136
+	public static function uninstall($type, $slug) {
137 137
 
138
-		if ( ! isset( self::$registered[ $type ][ $slug ] ) ) {
138
+		if ( ! isset(self::$registered[$type][$slug])) {
139 139
 			return false;
140 140
 		}
141 141
 
142
-		$installer = self::get_installer( $type, $slug );
142
+		$installer = self::get_installer($type, $slug);
143 143
 
144
-		if ( ! $installer ) {
144
+		if ( ! $installer) {
145 145
 			return false;
146 146
 		}
147 147
 
@@ -159,31 +159,31 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	public static function maybe_do_updates() {
161 161
 
162
-		$wordpoints_data = get_option( 'wordpoints_data' );
162
+		$wordpoints_data = get_option('wordpoints_data');
163 163
 
164
-		if ( is_wordpoints_network_active() ) {
165
-			$network_wide_data = get_site_option( 'wordpoints_data' );
164
+		if (is_wordpoints_network_active()) {
165
+			$network_wide_data = get_site_option('wordpoints_data');
166 166
 		}
167 167
 
168 168
 		$updated = false;
169 169
 
170
-		foreach ( self::$registered as $type => $installables ) {
170
+		foreach (self::$registered as $type => $installables) {
171 171
 
172
-			foreach ( $installables as $slug => $installable ) {
172
+			foreach ($installables as $slug => $installable) {
173 173
 
174
-				if ( isset( $network_wide_data ) && $installable['network_wide'] ) {
175
-					$data =& $network_wide_data;
174
+				if (isset($network_wide_data) && $installable['network_wide']) {
175
+					$data = & $network_wide_data;
176 176
 				} else {
177
-					$data =& $wordpoints_data;
177
+					$data = & $wordpoints_data;
178 178
 				}
179 179
 
180
-				if ( 'wordpoints' === $slug ) {
180
+				if ('wordpoints' === $slug) {
181 181
 
182
-					if ( ! isset( $data['version'] ) ) {
182
+					if ( ! isset($data['version'])) {
183 183
 						// WordPoints should always be installed at this point. If it
184 184
 						// isn't, the install script didn't run for some reason. See
185 185
 						// https://github.com/WordPoints/wordpoints/issues/349
186
-						self::install( $type, $slug, is_wordpoints_network_active() );
186
+						self::install($type, $slug, is_wordpoints_network_active());
187 187
 						continue;
188 188
 					}
189 189
 
@@ -192,32 +192,32 @@  discard block
 block discarded – undo
192 192
 				} else {
193 193
 
194 194
 					// This installable hasn't been installed yet, so we don't update.
195
-					if ( ! isset( $data[ "{$type}s" ][ $slug ]['version'] ) ) {
195
+					if ( ! isset($data["{$type}s"][$slug]['version'])) {
196 196
 						continue;
197 197
 					}
198 198
 
199
-					$db_version = $data[ "{$type}s" ][ $slug ]['version'];
199
+					$db_version = $data["{$type}s"][$slug]['version'];
200 200
 				}
201 201
 
202 202
 				$code_version = $installable['version'];
203 203
 
204 204
 				// If the DB version isn't less than the code version, we don't need to upgrade.
205
-				if ( version_compare( $db_version, $code_version ) !== -1 ) {
205
+				if (version_compare($db_version, $code_version) !== -1) {
206 206
 					continue;
207 207
 				}
208 208
 
209
-				$installer = self::get_installer( $type, $slug );
209
+				$installer = self::get_installer($type, $slug);
210 210
 
211
-				if ( ! $installer ) {
211
+				if ( ! $installer) {
212 212
 					continue;
213 213
 				}
214 214
 
215
-				$installer->update( $db_version, $code_version );
215
+				$installer->update($db_version, $code_version);
216 216
 
217
-				if ( 'wordpoints' === $slug ) {
217
+				if ('wordpoints' === $slug) {
218 218
 					$data['version'] = $code_version;
219 219
 				} else {
220
-					$data[ "{$type}s" ][ $slug ]['version'] = $code_version;
220
+					$data["{$type}s"][$slug]['version'] = $code_version;
221 221
 				}
222 222
 
223 223
 				$updated = true;
@@ -226,11 +226,11 @@  discard block
 block discarded – undo
226 226
 
227 227
 		} // End foreach ( installable types  ).
228 228
 
229
-		if ( $updated ) {
230
-			update_option( 'wordpoints_data', $wordpoints_data );
229
+		if ($updated) {
230
+			update_option('wordpoints_data', $wordpoints_data);
231 231
 
232
-			if ( isset( $network_wide_data ) ) {
233
-				update_site_option( 'wordpoints_data', $network_wide_data );
232
+			if (isset($network_wide_data)) {
233
+				update_site_option('wordpoints_data', $network_wide_data);
234 234
 			}
235 235
 		}
236 236
 	}
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
 	 */
245 245
 	public static function admin_notices() {
246 246
 
247
-		if ( ! is_wordpoints_network_active() ) {
247
+		if ( ! is_wordpoints_network_active()) {
248 248
 			return;
249 249
 		}
250 250
 
251
-		self::show_admin_notices( 'install' );
252
-		self::show_admin_notices( 'update' );
251
+		self::show_admin_notices('install');
252
+		self::show_admin_notices('update');
253 253
 	}
254 254
 
255 255
 	/**
@@ -259,49 +259,49 @@  discard block
 block discarded – undo
259 259
 	 *
260 260
 	 * @param string $notice_type The type of notices to display, 'update', or 'install'.
261 261
 	 */
262
-	protected static function show_admin_notices( $notice_type ) {
262
+	protected static function show_admin_notices($notice_type) {
263 263
 
264 264
 		$all_skipped = array_filter(
265
-			wordpoints_get_array_option( "wordpoints_network_{$notice_type}_skipped", 'site' )
265
+			wordpoints_get_array_option("wordpoints_network_{$notice_type}_skipped", 'site')
266 266
 		);
267 267
 
268
-		if ( empty( $all_skipped ) ) {
268
+		if (empty($all_skipped)) {
269 269
 			return;
270 270
 		}
271 271
 
272 272
 		$messages = array();
273 273
 
274
-		if ( 'install' === $notice_type ) {
274
+		if ('install' === $notice_type) {
275 275
 			// translators: 1. Module/plugin name; 2. "module", "plugin", or "component".
276
-			$message_template = __( 'WordPoints detected a large network and has skipped part of the installation process for the &#8220;%1$s&#8221; %2$s.', 'wordpoints' );
276
+			$message_template = __('WordPoints detected a large network and has skipped part of the installation process for the &#8220;%1$s&#8221; %2$s.', 'wordpoints');
277 277
 		} else {
278 278
 			// translators: 1. Module/plugin name; 2. "module", "plugin", or "component"; 3. Version number.
279
-			$message_template = __( 'WordPoints detected a large network and has skipped part of the update process for the &#8220;%1$s&#8221; %2$s for version %3$s (and possibly later versions).', 'wordpoints' );
279
+			$message_template = __('WordPoints detected a large network and has skipped part of the update process for the &#8220;%1$s&#8221; %2$s for version %3$s (and possibly later versions).', 'wordpoints');
280 280
 		}
281 281
 
282
-		foreach ( $all_skipped as $type => $skipped ) {
282
+		foreach ($all_skipped as $type => $skipped) {
283 283
 
284
-			if ( ! self::can_show_admin_notices( $type ) ) {
284
+			if ( ! self::can_show_admin_notices($type)) {
285 285
 				continue;
286 286
 			}
287 287
 
288
-			switch ( $type ) {
288
+			switch ($type) {
289 289
 
290 290
 				case 'module':
291
-					$type_name = __( 'module', 'wordpoints' );
291
+					$type_name = __('module', 'wordpoints');
292 292
 				break;
293 293
 
294 294
 				case 'component':
295
-					$type_name = __( 'component', 'wordpoints' );
295
+					$type_name = __('component', 'wordpoints');
296 296
 				break;
297 297
 
298 298
 				default:
299
-					$type_name = __( 'plugin', 'wordpoints' );
299
+					$type_name = __('plugin', 'wordpoints');
300 300
 			}
301 301
 
302
-			foreach ( $skipped as $slug => $version ) {
302
+			foreach ($skipped as $slug => $version) {
303 303
 
304
-				if ( empty( self::$registered[ $type ][ $slug ]['network_wide'] ) ) {
304
+				if (empty(self::$registered[$type][$slug]['network_wide'])) {
305 305
 					continue;
306 306
 				}
307 307
 
@@ -321,18 +321,18 @@  discard block
 block discarded – undo
321 321
 
322 322
 		} // End foreach ( $all_skipped ).
323 323
 
324
-		if ( ! empty( $messages ) ) {
324
+		if ( ! empty($messages)) {
325 325
 
326
-			$message = '<p>' . implode( '</p><p>', $messages ) . '</p>';
327
-			$message .= '<p>' . esc_html__( 'The rest of the process needs to be completed manually. If this has not been done already, some parts of the component may not function properly.', 'wordpoints' );
328
-			$message .= ' <a href="https://wordpoints.org/user-guide/multisite/">' . esc_html__( 'Learn more.', 'wordpoints' ) . '</a></p>';
326
+			$message = '<p>' . implode('</p><p>', $messages) . '</p>';
327
+			$message .= '<p>' . esc_html__('The rest of the process needs to be completed manually. If this has not been done already, some parts of the component may not function properly.', 'wordpoints');
328
+			$message .= ' <a href="https://wordpoints.org/user-guide/multisite/">' . esc_html__('Learn more.', 'wordpoints') . '</a></p>';
329 329
 
330 330
 			$args = array(
331 331
 				'dismissible' => true,
332 332
 				'option' => "wordpoints_network_{$notice_type}_skipped",
333 333
 			);
334 334
 
335
-			wordpoints_show_admin_error( $message, $args );
335
+			wordpoints_show_admin_error($message, $args);
336 336
 		}
337 337
 	}
338 338
 
@@ -345,15 +345,15 @@  discard block
 block discarded – undo
345 345
 	 *
346 346
 	 * @return bool Whether to display the admin notices.
347 347
 	 */
348
-	protected static function can_show_admin_notices( $type ) {
348
+	protected static function can_show_admin_notices($type) {
349 349
 
350
-		switch ( $type ) {
350
+		switch ($type) {
351 351
 
352 352
 			case 'module':
353
-				return current_user_can( 'wordpoints_manage_network_modules' );
353
+				return current_user_can('wordpoints_manage_network_modules');
354 354
 
355 355
 			default:
356
-				return current_user_can( 'manage_network_plugins' );
356
+				return current_user_can('manage_network_plugins');
357 357
 		}
358 358
 	}
359 359
 
@@ -367,26 +367,26 @@  discard block
 block discarded – undo
367 367
 	 *
368 368
 	 * @return WordPoints_Un_Installer_Base|false The installer.
369 369
 	 */
370
-	public static function get_installer( $type, $slug ) {
370
+	public static function get_installer($type, $slug) {
371 371
 
372
-		if ( ! isset( self::$registered[ $type ][ $slug ] ) ) {
372
+		if ( ! isset(self::$registered[$type][$slug])) {
373 373
 			return false;
374 374
 		}
375 375
 
376
-		if ( ! isset( self::$installers[ $type ][ $slug ] ) ) {
376
+		if ( ! isset(self::$installers[$type][$slug])) {
377 377
 
378
-			if ( ! file_exists( self::$registered[ $type ][ $slug ]['un_installer'] ) ) {
378
+			if ( ! file_exists(self::$registered[$type][$slug]['un_installer'])) {
379 379
 				return false;
380 380
 			}
381 381
 
382
-			self::$installers[ $type ][ $slug ] = require(
383
-				self::$registered[ $type ][ $slug ]['un_installer']
382
+			self::$installers[$type][$slug] = require(
383
+				self::$registered[$type][$slug]['un_installer']
384 384
 			);
385 385
 		}
386 386
 
387
-		return new self::$installers[ $type ][ $slug ](
387
+		return new self::$installers[$type][$slug](
388 388
 			$slug
389
-			, self::$registered[ $type ][ $slug ]['version']
389
+			, self::$registered[$type][$slug]['version']
390 390
 		);
391 391
 	}
392 392
 
@@ -399,28 +399,28 @@  discard block
 block discarded – undo
399 399
 	 *
400 400
 	 * @param int $blog_id The ID of the new blog.
401 401
 	 */
402
-	public static function wpmu_new_blog( $blog_id ) {
402
+	public static function wpmu_new_blog($blog_id) {
403 403
 
404
-		foreach ( self::$registered as $type => $installables ) {
404
+		foreach (self::$registered as $type => $installables) {
405 405
 
406 406
 			$network_installables = wp_list_filter(
407 407
 				$installables
408
-				, array( 'network_wide' => true )
408
+				, array('network_wide' => true)
409 409
 			);
410 410
 
411
-			if ( empty( $network_installables ) ) {
411
+			if (empty($network_installables)) {
412 412
 				continue;
413 413
 			}
414 414
 
415
-			foreach ( $network_installables as $slug => $installable ) {
415
+			foreach ($network_installables as $slug => $installable) {
416 416
 
417
-				$installer = self::get_installer( $type, $slug );
417
+				$installer = self::get_installer($type, $slug);
418 418
 
419
-				if ( ! $installer ) {
419
+				if ( ! $installer) {
420 420
 					continue;
421 421
 				}
422 422
 
423
-				$installer->install_on_site( $blog_id );
423
+				$installer->install_on_site($blog_id);
424 424
 			}
425 425
 		}
426 426
 	}
Please login to merge, or discard this patch.
src/classes/entity/array.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 	 *
53 53
 	 * @param string $entity_slug The slug of the entity type.
54 54
 	 */
55
-	public function __construct( $entity_slug ) {
55
+	public function __construct($entity_slug) {
56 56
 
57 57
 		$this->entity_slug = $entity_slug;
58
-		$this->entity_object = wordpoints_entities()->get( $this->entity_slug );
58
+		$this->entity_object = wordpoints_entities()->get($this->entity_slug);
59 59
 
60
-		parent::__construct( $this->entity_slug . '{}' );
60
+		parent::__construct($this->entity_slug . '{}');
61 61
 	}
62 62
 
63 63
 	/**
@@ -80,20 +80,20 @@  discard block
 block discarded – undo
80 80
 	 *
81 81
 	 * @return bool Whether the value was set successfully.
82 82
 	 */
83
-	public function set_the_value( $values ) {
83
+	public function set_the_value($values) {
84 84
 
85 85
 		$this->the_value = array();
86 86
 		$this->the_entities = array();
87 87
 
88
-		if ( ! ( $this->entity_object instanceof WordPoints_Entity ) ) {
88
+		if ( ! ($this->entity_object instanceof WordPoints_Entity)) {
89 89
 			return false;
90 90
 		}
91 91
 
92
-		foreach ( $values as $value ) {
92
+		foreach ($values as $value) {
93 93
 
94 94
 			$entity = clone $this->entity_object;
95 95
 
96
-			if ( $entity->set_the_value( $value ) ) {
96
+			if ($entity->set_the_value($value)) {
97 97
 				$this->the_entities[] = $entity;
98 98
 				$this->the_value[] = $entity->get_the_id();
99 99
 			}
@@ -118,16 +118,16 @@  discard block
 block discarded – undo
118 118
 	 */
119 119
 	public function get_title() {
120 120
 
121
-		if ( $this->entity_object ) {
121
+		if ($this->entity_object) {
122 122
 
123 123
 			return sprintf(
124 124
 				// translators: Singular name of an item.
125
-				__( '%s Collection', 'wordpoints' )
125
+				__('%s Collection', 'wordpoints')
126 126
 				, $this->entity_object->get_title()
127 127
 			);
128 128
 
129 129
 		} else {
130
-			return __( 'Item Collection', 'wordpoints' );
130
+			return __('Item Collection', 'wordpoints');
131 131
 		}
132 132
 	}
133 133
 }
Please login to merge, or discard this patch.
src/classes/entity/attr/stored/db/table/meta.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -85,30 +85,30 @@
 block discarded – undo
85 85
 	/**
86 86
 	 * @since 2.3.0
87 87
 	 */
88
-	public function __construct( $slug ) {
88
+	public function __construct($slug) {
89 89
 
90
-		if ( $this->meta_type ) {
90
+		if ($this->meta_type) {
91 91
 
92
-			if ( ! $this->wpdb_table_name ) {
92
+			if ( ! $this->wpdb_table_name) {
93 93
 				$this->wpdb_table_name = $this->meta_type . 'meta';
94 94
 			}
95 95
 
96
-			if ( ! $this->entity_id_field ) {
96
+			if ( ! $this->entity_id_field) {
97 97
 				$this->entity_id_field = $this->meta_type . '_id';
98 98
 			}
99 99
 		}
100 100
 
101
-		parent::__construct( $slug );
101
+		parent::__construct($slug);
102 102
 	}
103 103
 
104 104
 	/**
105 105
 	 * @since 2.3.0
106 106
 	 */
107
-	protected function get_attr_value_from_entity( WordPoints_Entity $entity ) {
107
+	protected function get_attr_value_from_entity(WordPoints_Entity $entity) {
108 108
 
109 109
 		$entity_id = $entity->get_the_id();
110 110
 
111
-		if ( ! $entity_id ) {
111
+		if ( ! $entity_id) {
112 112
 			return null;
113 113
 		}
114 114
 
Please login to merge, or discard this patch.
src/classes/entity/comment/post.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@
 block discarded – undo
37 37
 	/**
38 38
 	 * @since 2.1.0
39 39
 	 */
40
-	protected function get_related_entity_ids( WordPoints_Entity $entity ) {
41
-		return $entity->get_the_attr_value( $this->related_ids_field );
40
+	protected function get_related_entity_ids(WordPoints_Entity $entity) {
41
+		return $entity->get_the_attr_value($this->related_ids_field);
42 42
 	}
43 43
 
44 44
 	/**
Please login to merge, or discard this patch.
src/classes/entity/comment/author.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 	 * @since 2.1.0
39 39
 	 */
40 40
 	public function get_title() {
41
-		return __( 'Author', 'wordpoints' );
41
+		return __('Author', 'wordpoints');
42 42
 	}
43 43
 }
44 44
 
Please login to merge, or discard this patch.