Completed
Push — develop ( 192d27...cb660e )
by J.D.
03:12
created
src/components/points/admin/includes/functions.php 2 patches
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -143,7 +143,8 @@  discard block
 block discarded – undo
143 143
  */
144 144
 function wordpoints_points_admin_screen_hooks() {
145 145
 
146
-	if ( isset( $_GET['edithook'] ) || isset( $_POST['savehook'] ) || isset( $_POST['removehook'] ) ) { // WPCS: CSRF OK.
146
+	if ( isset( $_GET['edithook'] ) || isset( $_POST['savehook'] ) || isset( $_POST['removehook'] ) ) {
147
+// WPCS: CSRF OK.
147 148
 
148 149
 		// - We're doing this without AJAX (JS).
149 150
 
@@ -206,7 +207,8 @@  discard block
 block discarded – undo
206 207
  */
207 208
 function wordpoints_no_js_points_hooks_save() {
208 209
 
209
-	if ( ! isset( $_POST['savehook'] ) && ! isset( $_POST['removehook'] ) ) { // WPCS: CSRF OK.
210
+	if ( ! isset( $_POST['savehook'] ) && ! isset( $_POST['removehook'] ) ) {
211
+// WPCS: CSRF OK.
210 212
 		return;
211 213
 	}
212 214
 
@@ -290,9 +292,12 @@  discard block
 block discarded – undo
290 292
 
291 293
 	<?php if ( $has_form ) : ?>
292 294
 		<hr />
293
-	<?php else : ?>
295
+	<?php else {
296
+	: ?>
294 297
 		<br />
295
-	<?php endif; ?>
298
+	<?php endif;
299
+}
300
+?>
296 301
 
297 302
 	<div class="hook-instance-description">
298 303
 		<label for="<?php $hook->the_field_id( '_description' ); ?>"><?php echo esc_html_x( 'Description (optional):', 'points hook', 'wordpoints' ); ?></label>
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -438,17 +438,17 @@
 block discarded – undo
438 438
 
439 439
 		if (
440 440
 			isset(
441
-				$_POST[ "wordpoints_points_set-{$slug}" ]
442
-				, $_POST[ "wordpoints_points-{$slug}" ]
443
-				, $_POST[ "wordpoints_points_old-{$slug}" ]
441
+				$_POST["wordpoints_points_set-{$slug}"]
442
+				, $_POST["wordpoints_points-{$slug}"]
443
+				, $_POST["wordpoints_points_old-{$slug}"]
444 444
 			)
445
-			&& false !== wordpoints_int( $_POST[ "wordpoints_points-{$slug}" ] )
446
-			&& false !== wordpoints_int( $_POST[ "wordpoints_points_old-{$slug}" ] )
445
+			&& false !== wordpoints_int( $_POST["wordpoints_points-{$slug}"] )
446
+			&& false !== wordpoints_int( $_POST["wordpoints_points_old-{$slug}"] )
447 447
 		) {
448 448
 
449 449
 			wordpoints_alter_points(
450 450
 				$user_id
451
-				, (int) $_POST[ "wordpoints_points-{$slug}" ] - (int) $_POST[ "wordpoints_points_old-{$slug}" ]
451
+				, (int) $_POST["wordpoints_points-{$slug}"] - (int) $_POST["wordpoints_points_old-{$slug}"]
452 452
 				, $slug
453 453
 				, 'profile_edit'
454 454
 				, array(
Please login to merge, or discard this patch.
src/components/points/admin/screens/hooks.php 2 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,8 @@  discard block
 block discarded – undo
43 43
 		return;
44 44
 	}
45 45
 
46
-	if ( isset( $_GET['message'] ) && isset( $messages[ (int) $_GET['message'] ] ) ) { // WPCS: CSRF OK.
46
+	if ( isset( $_GET['message'] ) && isset( $messages[ (int) $_GET['message'] ] ) ) {
47
+// WPCS: CSRF OK.
47 48
 
48 49
 		wordpoints_show_admin_message(
49 50
 			esc_html( $messages[ (int) $_GET['message'] ] ) // WPCS: CSRF OK.
@@ -51,7 +52,8 @@  discard block
 block discarded – undo
51 52
 			, array( 'dismissible' => true )
52 53
 		);
53 54
 
54
-	} elseif ( isset( $_GET['error'] ) && isset( $errors[ (int) $_GET['error'] ] ) ) { // WPCS: CSRF OK.
55
+	} elseif ( isset( $_GET['error'] ) && isset( $errors[ (int) $_GET['error'] ] ) ) {
56
+// WPCS: CSRF OK.
55 57
 
56 58
 		wordpoints_show_admin_error(
57 59
 			esc_html( $errors[ (int) $_GET['error'] ] ) // WPCS: CSRF OK.
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,18 +43,18 @@
 block discarded – undo
43 43
 		return;
44 44
 	}
45 45
 
46
-	if ( isset( $_GET['message'] ) && isset( $messages[ (int) $_GET['message'] ] ) ) { // WPCS: CSRF OK.
46
+	if ( isset( $_GET['message'] ) && isset( $messages[(int) $_GET['message']] ) ) { // WPCS: CSRF OK.
47 47
 
48 48
 		wordpoints_show_admin_message(
49
-			esc_html( $messages[ (int) $_GET['message'] ] ) // WPCS: CSRF OK.
49
+			esc_html( $messages[(int) $_GET['message']] ) // WPCS: CSRF OK.
50 50
 			, 'success'
51 51
 			, array( 'dismissible' => true )
52 52
 		);
53 53
 
54
-	} elseif ( isset( $_GET['error'] ) && isset( $errors[ (int) $_GET['error'] ] ) ) { // WPCS: CSRF OK.
54
+	} elseif ( isset( $_GET['error'] ) && isset( $errors[(int) $_GET['error']] ) ) { // WPCS: CSRF OK.
55 55
 
56 56
 		wordpoints_show_admin_error(
57
-			esc_html( $errors[ (int) $_GET['error'] ] ) // WPCS: CSRF OK.
57
+			esc_html( $errors[(int) $_GET['error']] ) // WPCS: CSRF OK.
58 58
 			, array( 'dismissible' => true )
59 59
 		);
60 60
 	}
Please login to merge, or discard this patch.
src/components/points/classes/logs/view/table.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -222,7 +222,8 @@
 block discarded – undo
222 222
 
223 223
 		$search_term = '';
224 224
 
225
-		if ( isset( $_POST['wordpoints_points_logs_search'] ) ) { // WPCS: CSRF OK
225
+		if ( isset( $_POST['wordpoints_points_logs_search'] ) ) {
226
+// WPCS: CSRF OK
226 227
 			$search_term = trim(
227 228
 				sanitize_text_field(
228 229
 					wp_unslash( $_POST['wordpoints_points_logs_search'] ) // WPCS: CSRF OK
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 		$extra_classes = array();
87 87
 
88 88
 		foreach ( array( 'searchable', 'paginate' ) as $arg ) {
89
-			if ( $this->args[ $arg ] ) {
89
+			if ( $this->args[$arg] ) {
90 90
 				$extra_classes[] = $arg;
91 91
 			}
92 92
 		}
Please login to merge, or discard this patch.
src/classes/entity.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -453,7 +453,7 @@
 block discarded – undo
453 453
 	 *
454 454
 	 * @since 2.1.0
455 455
 	 *
456
-	 * @return mixed The ID of the entity.
456
+	 * @return integer The ID of the entity.
457 457
 	 */
458 458
 	public function get_the_id() {
459 459
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
 		$context = $this->get_context();
197 197
 
198 198
 		return (
199
-			isset( $guid[ $this->get_slug() ] )
200
-			&& ( '' === $context || isset( $guid[ $context ] ) )
199
+			isset( $guid[$this->get_slug()] )
200
+			&& ( '' === $context || isset( $guid[$context] ) )
201 201
 		);
202 202
 	}
203 203
 
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
 	protected function split_guid( $guid ) {
217 217
 
218 218
 		$slug    = $this->get_slug();
219
-		$id      = $guid[ $slug ];
219
+		$id      = $guid[$slug];
220 220
 		$context = $guid;
221 221
 
222
-		unset( $context[ $slug ] );
222
+		unset( $context[$slug] );
223 223
 
224 224
 		return array( 'id' => $id, 'context' => $context );
225 225
 	}
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
 	protected function get_attr_value( $entity, $attr ) {
238 238
 
239 239
 		if ( is_array( $entity ) ) {
240
-			if ( isset( $entity[ $attr ] ) ) {
241
-				return $entity[ $attr ];
240
+			if ( isset( $entity[$attr] ) ) {
241
+				return $entity[$attr];
242 242
 			}
243 243
 		} else {
244 244
 			if ( isset( $entity->{$attr} ) ) {
Please login to merge, or discard this patch.
src/classes/extension/updatesi.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -29,6 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @since 2.4.0
30 30
 	 *
31 31
 	 * @param int $time The timestamp that the extension update check was performed.
32
+	 * @return void
32 33
 	 */
33 34
 	public function set_time_checked( $time );
34 35
 
@@ -48,6 +49,7 @@  discard block
 block discarded – undo
48 49
 	 *
49 50
 	 * @param string[] $versions The extension versions that were checked, indexed by
50 51
 	 *                           extension basename.
52
+	 * @return void
51 53
 	 */
52 54
 	public function set_versions_checked( array $versions );
53 55
 
@@ -67,6 +69,7 @@  discard block
 block discarded – undo
67 69
 	 *
68 70
 	 * @param string[] $versions The new extension versions that are available to
69 71
 	 *                           update to, indexed by extension basename.
72
+	 * @return void
70 73
 	 */
71 74
 	public function set_new_versions( array $versions );
72 75
 
@@ -99,6 +102,7 @@  discard block
 block discarded – undo
99 102
 	 *
100 103
 	 * @param string $extension The extension basename.
101 104
 	 * @param string $version   The new version available.
105
+	 * @return void
102 106
 	 */
103 107
 	public function set_new_version( $extension, $version );
104 108
 }
Please login to merge, or discard this patch.
src/classes/installablei.php 1 patch
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -57,6 +57,7 @@  discard block
 block discarded – undo
57 57
 	 * @param string $version The version to set. Defaults to the code version.
58 58
 	 * @param bool   $network Whether to set the network version of the entity, or
59 59
 	 *                        just for the current site.
60
+	 * @return void
60 61
 	 */
61 62
 	public function set_db_version( $version = null, $network = false );
62 63
 
@@ -67,6 +68,7 @@  discard block
 block discarded – undo
67 68
 	 *
68 69
 	 * @param bool $network Whether to delete the network version of the entity, or
69 70
 	 *                      just for the current site.
71
+	 * @return void
70 72
 	 */
71 73
 	public function unset_db_version( $network = false );
72 74
 
@@ -88,6 +90,7 @@  discard block
 block discarded – undo
88 90
 	 * Sets this entity's status as network-installed.
89 91
 	 *
90 92
 	 * @since 2.4.0
93
+	 * @return void
91 94
 	 */
92 95
 	public function set_network_installed();
93 96
 
@@ -95,6 +98,7 @@  discard block
 block discarded – undo
95 98
 	 * Deletes this entity's status as network-installed.
96 99
 	 *
97 100
 	 * @since 2.4.0
101
+	 * @return void
98 102
 	 */
99 103
 	public function unset_network_installed();
100 104
 
@@ -102,6 +106,7 @@  discard block
 block discarded – undo
102 106
 	 * Sets that the per-site network installation has been skipped.
103 107
 	 *
104 108
 	 * @since 2.4.0
109
+	 * @return void
105 110
 	 */
106 111
 	public function set_network_install_skipped();
107 112
 
@@ -109,6 +114,7 @@  discard block
 block discarded – undo
109 114
 	 * Deletes the network-install skipped flag for this entity.
110 115
 	 *
111 116
 	 * @since 2.4.0
117
+	 * @return void
112 118
 	 */
113 119
 	public function unset_network_install_skipped();
114 120
 
@@ -119,6 +125,7 @@  discard block
 block discarded – undo
119 125
 	 *
120 126
 	 * @param string $updating_from The version that was being updated from. Defaults
121 127
 	 *                              to the current database version.
128
+	 * @return void
122 129
 	 */
123 130
 	public function set_network_update_skipped( $updating_from = null );
124 131
 
@@ -126,6 +133,7 @@  discard block
 block discarded – undo
126 133
 	 * Deletes the network-update skipped flag for this entity.
127 134
 	 *
128 135
 	 * @since 2.4.0
136
+	 * @return void
129 137
 	 */
130 138
 	public function unset_network_update_skipped();
131 139
 
@@ -154,6 +162,7 @@  discard block
 block discarded – undo
154 162
 	 * @since 2.4.0
155 163
 	 *
156 164
 	 * @param int $id The ID of the site to add. Defaults to the current site's ID.
165
+	 * @return void
157 166
 	 */
158 167
 	public function add_installed_site_id( $id = null );
159 168
 
@@ -161,6 +170,7 @@  discard block
 block discarded – undo
161 170
 	 * Deletes the list of sites where this installable is installed.
162 171
 	 *
163 172
 	 * @since 2.4.0
173
+	 * @return void
164 174
 	 */
165 175
 	public function delete_installed_site_ids();
166 176
 
Please login to merge, or discard this patch.
src/classes/installables.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@
 block discarded – undo
211 211
 	 * @param string $version      The version of the installable. Only used if $un_installer is passed.
212 212
 	 * @param string $un_installer The path to the un/installer file.
213 213
 	 *
214
-	 * @return WordPoints_Un_Installer_Base|false The installer.
214
+	 * @return WordPoints_Un_Installer_Base The installer.
215 215
 	 */
216 216
 	public static function get_installer( $type, $slug, $version = null, $un_installer = null ) {
217 217
 
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 			, 'WordPoints_Installables_App::register'
95 95
 		);
96 96
 
97
-		self::$registered[ $type ][ $slug ] = $data;
97
+		self::$registered[$type][$slug] = $data;
98 98
 
99 99
 		/** @var WordPoints_Installables_App $installables */
100 100
 		$installables = wordpoints_apps()->get_sub_app( 'installables' );
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
 		_deprecated_function( __METHOD__, '2.4.0' );
127 127
 
128
-		if ( ! isset( self::$registered[ $type ][ $slug ] ) ) {
128
+		if ( ! isset( self::$registered[$type][$slug] ) ) {
129 129
 			return false;
130 130
 		}
131 131
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 		_deprecated_function( __METHOD__, '2.4.0' );
157 157
 
158
-		if ( ! isset( self::$registered[ $type ][ $slug ] ) ) {
158
+		if ( ! isset( self::$registered[$type][$slug] ) ) {
159 159
 			return false;
160 160
 		}
161 161
 
@@ -217,24 +217,24 @@  discard block
 block discarded – undo
217 217
 
218 218
 		if ( ! isset( $un_installer ) ) {
219 219
 
220
-			if ( ! isset( self::$registered[ $type ][ $slug ] ) ) {
220
+			if ( ! isset( self::$registered[$type][$slug] ) ) {
221 221
 				return false;
222 222
 			}
223 223
 
224
-			$version      = self::$registered[ $type ][ $slug ]['version'];
225
-			$un_installer = self::$registered[ $type ][ $slug ]['un_installer'];
224
+			$version      = self::$registered[$type][$slug]['version'];
225
+			$un_installer = self::$registered[$type][$slug]['un_installer'];
226 226
 		}
227 227
 
228
-		if ( ! isset( self::$installers[ $type ][ $slug ] ) ) {
228
+		if ( ! isset( self::$installers[$type][$slug] ) ) {
229 229
 
230 230
 			if ( ! file_exists( $un_installer ) ) {
231 231
 				return false;
232 232
 			}
233 233
 
234
-			self::$installers[ $type ][ $slug ] = require $un_installer;
234
+			self::$installers[$type][$slug] = require $un_installer;
235 235
 		}
236 236
 
237
-		return new self::$installers[ $type ][ $slug ]( $slug, $version );
237
+		return new self::$installers[$type][$slug]( $slug, $version );
238 238
 	}
239 239
 
240 240
 	/**
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 		return new WordPoints_Installable_Legacy(
272 272
 			$type
273 273
 			, $slug
274
-			, self::$registered[ $type ][ $slug ]['version']
274
+			, self::$registered[$type][$slug]['version']
275 275
 		);
276 276
 	}
277 277
 }
Please login to merge, or discard this patch.
src/classes/modules.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
 	 * @param string $module The full path to one of the module's files.
110 110
 	 * @param string $data   The slug of the piece of data to get.
111 111
 	 *
112
-	 * @return string[]|string|false The data, or false if it isn't registered.
112
+	 * @return string The data, or false if it isn't registered.
113 113
 	 */
114 114
 	public static function get_data( $module, $data = null ) {
115 115
 
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -115,19 +115,19 @@  discard block
 block discarded – undo
115 115
 
116 116
 		$slug = self::get_slug( $module );
117 117
 
118
-		if ( ! isset( self::$registered[ $slug ] ) ) {
118
+		if ( ! isset( self::$registered[$slug] ) ) {
119 119
 			return false;
120 120
 		}
121 121
 
122 122
 		if ( $data ) {
123
-			if ( ! isset( self::$registered[ $slug ][ $data ] ) ) {
123
+			if ( ! isset( self::$registered[$slug][$data] ) ) {
124 124
 				return false;
125 125
 			}
126 126
 
127
-			return self::$registered[ $slug ][ $data ];
127
+			return self::$registered[$slug][$data];
128 128
 		}
129 129
 
130
-		return self::$registered[ $slug ];
130
+		return self::$registered[$slug];
131 131
 	}
132 132
 
133 133
 	/**
@@ -144,14 +144,14 @@  discard block
 block discarded – undo
144 144
 
145 145
 		$slug = self::get_slug( $file );
146 146
 
147
-		if ( isset( self::$registered[ $slug ] ) ) {
147
+		if ( isset( self::$registered[$slug] ) ) {
148 148
 			return false;
149 149
 		}
150 150
 
151
-		self::$registered[ $slug ] = self::parse_headers( $data );
151
+		self::$registered[$slug] = self::parse_headers( $data );
152 152
 
153
-		self::$registered[ $slug ]['raw']      = $data;
154
-		self::$registered[ $slug ]['raw_file'] = wp_normalize_path( $file );
153
+		self::$registered[$slug]['raw']      = $data;
154
+		self::$registered[$slug]['raw_file'] = wp_normalize_path( $file );
155 155
 
156 156
 		self::register_installable( $slug, $file );
157 157
 		self::maybe_load_textdomain( $slug, $file );
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
 
187 187
 			$data_slug = trim( $parts[0] );
188 188
 
189
-			if ( isset( self::$default_headers[ $parts[0] ] ) ) {
190
-				$data_slug = self::$default_headers[ $parts[0] ];
189
+			if ( isset( self::$default_headers[$parts[0]] ) ) {
190
+				$data_slug = self::$default_headers[$parts[0]];
191 191
 			}
192 192
 
193
-			$parsed[ $data_slug ] = trim( $parts[1] );
193
+			$parsed[$data_slug] = trim( $parts[1] );
194 194
 		}
195 195
 
196 196
 		return $parsed + array_fill_keys( self::$default_headers, '' );
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 			'extension'
211 211
 			, $slug
212 212
 			, 'WordPoints_Modules::get_installable'
213
-			, self::$registered[ $slug ]['version']
213
+			, self::$registered[$slug]['version']
214 214
 			, is_wordpoints_module_active_for_network( $file )
215 215
 		);
216 216
 	}
@@ -225,18 +225,18 @@  discard block
 block discarded – undo
225 225
 	 */
226 226
 	private static function maybe_load_textdomain( $slug, $file ) {
227 227
 
228
-		if ( empty( self::$registered[ $slug ]['text_domain'] ) ) {
228
+		if ( empty( self::$registered[$slug]['text_domain'] ) ) {
229 229
 			return;
230 230
 		}
231 231
 
232 232
 		$path = false;
233 233
 
234
-		if ( ! empty( self::$registered[ $slug ]['domain_path'] ) ) {
235
-			$path = wordpoints_module_basename( $file ) . self::$registered[ $slug ]['domain_path'];
234
+		if ( ! empty( self::$registered[$slug]['domain_path'] ) ) {
235
+			$path = wordpoints_module_basename( $file ) . self::$registered[$slug]['domain_path'];
236 236
 		}
237 237
 
238 238
 		wordpoints_load_module_textdomain(
239
-			self::$registered[ $slug ]['text_domain']
239
+			self::$registered[$slug]['text_domain']
240 240
 			, $path
241 241
 		);
242 242
 	}
@@ -264,8 +264,8 @@  discard block
 block discarded – undo
264 264
 			WordPoints_Installables::get_installer(
265 265
 				'module'
266 266
 				, $slug
267
-				, self::$registered[ $slug ]['version']
268
-				, dirname( self::$registered[ $slug ]['raw_file'] ) . '/includes/class-un-installer.php'
267
+				, self::$registered[$slug]['version']
268
+				, dirname( self::$registered[$slug]['raw_file'] ) . '/includes/class-un-installer.php'
269 269
 			)
270 270
 				->install( $network_wide );
271 271
 
@@ -290,11 +290,11 @@  discard block
 block discarded – undo
290 290
 
291 291
 		$installable = false;
292 292
 
293
-		if ( ! isset( self::$registered[ $slug ] ) ) {
293
+		if ( ! isset( self::$registered[$slug] ) ) {
294 294
 			return $installable;
295 295
 		}
296 296
 
297
-		$module = self::$registered[ $slug ];
297
+		$module = self::$registered[$slug];
298 298
 
299 299
 		$uninstaller = dirname( $module['raw_file'] ) . '/includes/class-un-installer.php';
300 300
 
Please login to merge, or discard this patch.
src/classes/routinei.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -18,6 +18,7 @@
 block discarded – undo
18 18
 	 * Runs the routine.
19 19
 	 *
20 20
 	 * @since 2.4.0
21
+	 * @return null|boolean
21 22
 	 */
22 23
 	public function run();
23 24
 }
Please login to merge, or discard this patch.