Completed
Push — master ( 2bd2c3...b43b5b )
by J.D.
03:07
created
src/includes/classes/hook/reactor/points.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function get_settings_fields() {
55 55
 
56
-		$this->settings_fields['points']['label'] = _x( 'Points', 'form label', 'wordpoints' );
57
-		$this->settings_fields['log_text']['label'] = _x( 'Log Text', 'form label', 'wordpoints' );
58
-		$this->settings_fields['description']['label'] = _x( 'Description', 'form label', 'wordpoints' );
56
+		$this->settings_fields['points']['label'] = _x('Points', 'form label', 'wordpoints');
57
+		$this->settings_fields['log_text']['label'] = _x('Log Text', 'form label', 'wordpoints');
58
+		$this->settings_fields['description']['label'] = _x('Description', 'form label', 'wordpoints');
59 59
 
60 60
 		return parent::get_settings_fields();
61 61
 	}
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 
68 68
 		$data = parent::get_ui_script_data();
69 69
 
70
-		$data['target_label'] = __( 'Award To', 'wordpoints' );
71
-		$data['periods_label'] = __( 'Award each user no more than once per:', 'wordpoints' );
70
+		$data['target_label'] = __('Award To', 'wordpoints');
71
+		$data['periods_label'] = __('Award each user no more than once per:', 'wordpoints');
72 72
 
73 73
 		return $data;
74 74
 	}
@@ -82,23 +82,23 @@  discard block
 block discarded – undo
82 82
 		WordPoints_Hook_Event_Args $event_args
83 83
 	) {
84 84
 
85
-		if ( ! isset( $settings['points'] ) || false === wordpoints_int( $settings['points'] ) ) {
86
-			$validator->add_error( __( 'Points must be an integer.', 'wordpoints' ), 'points' );
85
+		if ( ! isset($settings['points']) || false === wordpoints_int($settings['points'])) {
86
+			$validator->add_error(__('Points must be an integer.', 'wordpoints'), 'points');
87 87
 		}
88 88
 
89
-		if ( ! isset( $settings['points_type'] ) || ! wordpoints_is_points_type( $settings['points_type'] ) ) {
90
-			$validator->add_error( __( 'Invalid points type.', 'wordpoints' ), 'points_type' );
89
+		if ( ! isset($settings['points_type']) || ! wordpoints_is_points_type($settings['points_type'])) {
90
+			$validator->add_error(__('Invalid points type.', 'wordpoints'), 'points_type');
91 91
 		}
92 92
 
93
-		if ( ! isset( $settings['description'] ) ) {
94
-			$validator->add_error( __( 'Description is required.', 'wordpoints' ), 'description' );
93
+		if ( ! isset($settings['description'])) {
94
+			$validator->add_error(__('Description is required.', 'wordpoints'), 'description');
95 95
 		}
96 96
 
97
-		if ( ! isset( $settings['log_text'] ) ) {
98
-			$validator->add_error( __( 'Log Text is required.', 'wordpoints' ), 'log_text' );
97
+		if ( ! isset($settings['log_text'])) {
98
+			$validator->add_error(__('Log Text is required.', 'wordpoints'), 'log_text');
99 99
 		}
100 100
 
101
-		return parent::validate_settings( $settings, $validator, $event_args );
101
+		return parent::validate_settings($settings, $validator, $event_args);
102 102
 	}
103 103
 
104 104
 	/**
@@ -109,49 +109,49 @@  discard block
 block discarded – undo
109 109
 		array $settings
110 110
 	) {
111 111
 
112
-		parent::update_settings( $reaction, $settings );
112
+		parent::update_settings($reaction, $settings);
113 113
 
114
-		$reaction->update_meta( 'points', $settings['points'] );
115
-		$reaction->update_meta( 'points_type', $settings['points_type'] );
116
-		$reaction->update_meta( 'description', $settings['description'] );
117
-		$reaction->update_meta( 'log_text', $settings['log_text'] );
114
+		$reaction->update_meta('points', $settings['points']);
115
+		$reaction->update_meta('points_type', $settings['points_type']);
116
+		$reaction->update_meta('description', $settings['description']);
117
+		$reaction->update_meta('log_text', $settings['log_text']);
118 118
 	}
119 119
 
120 120
 	/**
121 121
 	 * @since 1.0.0
122 122
 	 */
123
-	public function hit( WordPoints_Hook_Fire $fire ) {
123
+	public function hit(WordPoints_Hook_Fire $fire) {
124 124
 
125 125
 		$reaction = $fire->reaction;
126 126
 
127 127
 		$target = $fire->event_args->get_from_hierarchy(
128
-			$reaction->get_meta( 'target' )
128
+			$reaction->get_meta('target')
129 129
 		);
130 130
 
131
-		if ( ! $target instanceof WordPoints_Entity ) {
131
+		if ( ! $target instanceof WordPoints_Entity) {
132 132
 			return;
133 133
 		}
134 134
 
135 135
 		$meta = array();
136 136
 
137
-		foreach ( $fire->event_args->get_entities() as $entity ) {
138
-			$meta[ $entity->get_slug() ] = $entity->get_the_id();
137
+		foreach ($fire->event_args->get_entities() as $entity) {
138
+			$meta[$entity->get_slug()] = $entity->get_the_id();
139 139
 		}
140 140
 
141 141
 		wordpoints_alter_points(
142 142
 			$target->get_the_id()
143
-			, $reaction->get_meta( 'points' )
144
-			, $reaction->get_meta( 'points_type' )
143
+			, $reaction->get_meta('points')
144
+			, $reaction->get_meta('points_type')
145 145
 			, $reaction->get_event_slug()
146 146
 			, $meta
147
-			, $reaction->get_meta( 'log_text' )
147
+			, $reaction->get_meta('log_text')
148 148
 		);
149 149
 	}
150 150
 
151 151
 	/**
152 152
 	 * @since 1.0.0
153 153
 	 */
154
-	public function reverse_hit( WordPoints_Hook_Fire $fire ) {
154
+	public function reverse_hit(WordPoints_Hook_Fire $fire) {
155 155
 
156 156
 		$meta_queries = array(
157 157
 			array(
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 			),
163 163
 		);
164 164
 
165
-		foreach ( $fire->event_args->get_entities() as $slug => $entity ) {
165
+		foreach ($fire->event_args->get_entities() as $slug => $entity) {
166 166
 
167 167
 			$meta_queries[] = array(
168 168
 				'key'   => $slug,
@@ -179,35 +179,35 @@  discard block
 block discarded – undo
179 179
 
180 180
 		$logs = $query->get();
181 181
 
182
-		if ( ! $logs ) {
182
+		if ( ! $logs) {
183 183
 			return;
184 184
 		}
185 185
 
186 186
 		global $wpdb;
187 187
 
188
-		add_filter( 'wordpoints_points_log', '__return_false' );
188
+		add_filter('wordpoints_points_log', '__return_false');
189 189
 
190
-		foreach ( $logs as $log ) {
190
+		foreach ($logs as $log) {
191 191
 
192 192
 			wordpoints_alter_points(
193 193
 				$log->user_id
194 194
 				, -$log->points
195 195
 				, $log->points_type
196 196
 				, "reverse-{$log->log_type}"
197
-				, array( 'original_log_id' => $log->id )
197
+				, array('original_log_id' => $log->id)
198 198
 			);
199 199
 
200
-			wordpoints_points_log_delete_all_metadata( $log->id );
200
+			wordpoints_points_log_delete_all_metadata($log->id);
201 201
 
202 202
 			// Now delete the log.
203 203
 			$wpdb->delete(
204 204
 				$wpdb->wordpoints_points_logs
205
-				, array( 'id' => $log->id )
205
+				, array('id' => $log->id)
206 206
 				, '%d'
207 207
 			); // WPCS: cache OK, cleaned by wordpoints_alter_points().
208 208
 		}
209 209
 
210
-		remove_filter( 'wordpoints_points_log', '__return_false' );
210
+		remove_filter('wordpoints_points_log', '__return_false');
211 211
 	}
212 212
 }
213 213
 
Please login to merge, or discard this patch.
src/admin/includes/classes/ajax/hooks.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 	) {
97 97
 
98 98
 		return 'wordpoints_create_hook_reaction'
99
-		       . '|' . $reactor->get_slug()
100
-		       . '|' . wordpoints_hooks()->get_current_mode()
101
-		       . '|' . wp_json_encode( $reactor->reactions->get_context_id() );
99
+			   . '|' . $reactor->get_slug()
100
+			   . '|' . wordpoints_hooks()->get_current_mode()
101
+			   . '|' . wp_json_encode( $reactor->reactions->get_context_id() );
102 102
 	}
103 103
 
104 104
 	/**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		WordPoints_Hook_ReactionI $reaction
129 129
 	) {
130 130
 		return 'wordpoints_update_hook_reaction|'
131
-		       . wp_json_encode( $reaction->get_guid() );
131
+			   . wp_json_encode( $reaction->get_guid() );
132 132
 	}
133 133
 
134 134
 	/**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		WordPoints_Hook_ReactionI $reaction
159 159
 	) {
160 160
 		return 'wordpoints_delete_hook_reaction|'
161
-		       . wp_json_encode( $reaction->get_guid() );
161
+			   . wp_json_encode( $reaction->get_guid() );
162 162
 	}
163 163
 
164 164
 	//
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 *
53 53
 	 * @return array The hook reaction data extracted into an array.
54 54
 	 */
55
-	public static function prepare_hook_reaction( WordPoints_Hook_ReactionI $reaction ) {
55
+	public static function prepare_hook_reaction(WordPoints_Hook_ReactionI $reaction) {
56 56
 
57 57
 		return array_merge(
58 58
 			$reaction->get_all_meta()
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 				'id' => $reaction->ID,
61 61
 				'event' => $reaction->get_event_slug(),
62 62
 				'reactor' => $reaction->get_reactor_slug(),
63
-				'nonce' => self::get_update_nonce( $reaction ),
64
-				'delete_nonce' => self::get_delete_nonce( $reaction ),
63
+				'nonce' => self::get_update_nonce($reaction),
64
+				'delete_nonce' => self::get_delete_nonce($reaction),
65 65
 			)
66 66
 		);
67 67
 	}
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 	 *
77 77
 	 * @return string A nonce for creating a new reaction to this reactor.
78 78
 	 */
79
-	public static function get_create_nonce( WordPoints_Hook_Reactor $reactor ) {
79
+	public static function get_create_nonce(WordPoints_Hook_Reactor $reactor) {
80 80
 
81
-		return wp_create_nonce( self::get_create_nonce_action( $reactor ) );
81
+		return wp_create_nonce(self::get_create_nonce_action($reactor));
82 82
 	}
83 83
 
84 84
 	/**
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
 	) {
97 97
 
98 98
 		return 'wordpoints_create_hook_reaction'
99
-		       . '|' . $reactor->get_slug()
100
-		       . '|' . wordpoints_hooks()->get_current_mode()
101
-		       . '|' . wp_json_encode( $reactor->reactions->get_context_id() );
99
+		       . '|'.$reactor->get_slug()
100
+		       . '|'.wordpoints_hooks()->get_current_mode()
101
+		       . '|'.wp_json_encode($reactor->reactions->get_context_id());
102 102
 	}
103 103
 
104 104
 	/**
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
 	 *
111 111
 	 * @return string A nonce for updating this reaction.
112 112
 	 */
113
-	public static function get_update_nonce( WordPoints_Hook_ReactionI $reaction ) {
113
+	public static function get_update_nonce(WordPoints_Hook_ReactionI $reaction) {
114 114
 
115
-		return wp_create_nonce( self::get_update_nonce_action( $reaction ) );
115
+		return wp_create_nonce(self::get_update_nonce_action($reaction));
116 116
 	}
117 117
 
118 118
 	/**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 		WordPoints_Hook_ReactionI $reaction
129 129
 	) {
130 130
 		return 'wordpoints_update_hook_reaction|'
131
-		       . wp_json_encode( $reaction->get_guid() );
131
+		       . wp_json_encode($reaction->get_guid());
132 132
 	}
133 133
 
134 134
 	/**
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 	 *
141 141
 	 * @return string A nonce for deleting this reaction.
142 142
 	 */
143
-	public static function get_delete_nonce( WordPoints_Hook_ReactionI $reaction ) {
143
+	public static function get_delete_nonce(WordPoints_Hook_ReactionI $reaction) {
144 144
 
145
-		return wp_create_nonce( self::get_delete_nonce_action( $reaction ) );
145
+		return wp_create_nonce(self::get_delete_nonce_action($reaction));
146 146
 	}
147 147
 
148 148
 	/**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		WordPoints_Hook_ReactionI $reaction
159 159
 	) {
160 160
 		return 'wordpoints_delete_hook_reaction|'
161
-		       . wp_json_encode( $reaction->get_guid() );
161
+		       . wp_json_encode($reaction->get_guid());
162 162
 	}
163 163
 
164 164
 	//
@@ -184,17 +184,17 @@  discard block
 block discarded – undo
184 184
 
185 185
 		add_action(
186 186
 			'wp_ajax_wordpoints_admin_create_hook_reaction'
187
-			, array( $this, 'create_hook_reaction' )
187
+			, array($this, 'create_hook_reaction')
188 188
 		);
189 189
 
190 190
 		add_action(
191 191
 			'wp_ajax_wordpoints_admin_update_hook_reaction'
192
-			, array( $this, 'update_hook_reaction' )
192
+			, array($this, 'update_hook_reaction')
193 193
 		);
194 194
 
195 195
 		add_action(
196 196
 			'wp_ajax_wordpoints_admin_delete_hook_reaction'
197
-			, array( $this, 'delete_hook_reaction' )
197
+			, array($this, 'delete_hook_reaction')
198 198
 		);
199 199
 	}
200 200
 
@@ -209,11 +209,11 @@  discard block
 block discarded – undo
209 209
 
210 210
 		$reactor = $this->get_reactor();
211 211
 
212
-		$this->verify_request( $this->get_create_nonce_action( $reactor ) );
212
+		$this->verify_request($this->get_create_nonce_action($reactor));
213 213
 
214
-		$reaction = $reactor->reactions->create_reaction( $this->get_data() );
214
+		$reaction = $reactor->reactions->create_reaction($this->get_data());
215 215
 
216
-		$this->send_json_result( $reaction, 'create' );
216
+		$this->send_json_result($reaction, 'create');
217 217
 	}
218 218
 
219 219
 	/**
@@ -228,14 +228,14 @@  discard block
 block discarded – undo
228 228
 		$reactor  = $this->get_reactor();
229 229
 		$reaction = $this->get_reaction();
230 230
 
231
-		$this->verify_request( $this->get_update_nonce_action( $reaction ) );
231
+		$this->verify_request($this->get_update_nonce_action($reaction));
232 232
 
233 233
 		$reaction = $reactor->reactions->update_reaction(
234 234
 			$reaction->ID
235 235
 			, $this->get_data()
236 236
 		);
237 237
 
238
-		$this->send_json_result( $reaction, 'update' );
238
+		$this->send_json_result($reaction, 'update');
239 239
 	}
240 240
 
241 241
 	/**
@@ -250,12 +250,12 @@  discard block
 block discarded – undo
250 250
 		$reactor  = $this->get_reactor();
251 251
 		$reaction = $this->get_reaction();
252 252
 
253
-		$this->verify_request( $this->get_delete_nonce_action( $reaction ) );
253
+		$this->verify_request($this->get_delete_nonce_action($reaction));
254 254
 
255
-		$result = $reactor->reactions->delete_reaction( $reaction->ID );
255
+		$result = $reactor->reactions->delete_reaction($reaction->ID);
256 256
 
257
-		if ( ! $result ) {
258
-			wp_send_json_error( array( 'message' => __( 'There was an error deleting the reaction. Please try again.', 'wordpoints' ) ) );
257
+		if ( ! $result) {
258
+			wp_send_json_error(array('message' => __('There was an error deleting the reaction. Please try again.', 'wordpoints')));
259 259
 		}
260 260
 
261 261
 		wp_send_json_success();
@@ -276,11 +276,11 @@  discard block
 block discarded – undo
276 276
 	 *
277 277
 	 * @param string $debug_context Context sent with the message (for debugging).
278 278
 	 */
279
-	private function unexpected_error( $debug_context ) {
279
+	private function unexpected_error($debug_context) {
280 280
 
281 281
 		wp_send_json_error(
282 282
 			array(
283
-				'message' => __( 'There was an unexpected error. Try reloading the page.', 'wordpoints' ),
283
+				'message' => __('There was an unexpected error. Try reloading the page.', 'wordpoints'),
284 284
 				'debug'   => $debug_context,
285 285
 			)
286 286
 		);
@@ -296,8 +296,8 @@  discard block
 block discarded – undo
296 296
 	 */
297 297
 	private function verify_user_can() {
298 298
 
299
-		if ( ! current_user_can( 'manage_options' ) ) {
300
-			wp_send_json_error( array( 'message' => __( 'You do not have permission to perform this action. Maybe you have been logged out?', 'wordpoints' ) ) );
299
+		if ( ! current_user_can('manage_options')) {
300
+			wp_send_json_error(array('message' => __('You do not have permission to perform this action. Maybe you have been logged out?', 'wordpoints')));
301 301
 		}
302 302
 	}
303 303
 
@@ -310,14 +310,14 @@  discard block
 block discarded – undo
310 310
 	 *
311 311
 	 * @param string $action The action the nonce should be for.
312 312
 	 */
313
-	private function verify_request( $action ) {
313
+	private function verify_request($action) {
314 314
 
315 315
 		if (
316
-			empty( $_POST['nonce'] )
317
-			|| ! wordpoints_verify_nonce( 'nonce', $action, null, 'post' )
316
+			empty($_POST['nonce'])
317
+			|| ! wordpoints_verify_nonce('nonce', $action, null, 'post')
318 318
 		) {
319 319
 			wp_send_json_error(
320
-				array( 'message' => __( 'Your security token for this action has expired. Refresh the page and try again.', 'wordpoints' ) )
320
+				array('message' => __('Your security token for this action has expired. Refresh the page and try again.', 'wordpoints'))
321 321
 			);
322 322
 		}
323 323
 	}
@@ -331,16 +331,16 @@  discard block
 block discarded – undo
331 331
 	 */
332 332
 	protected function get_reactor() {
333 333
 
334
-		if ( ! isset( $_POST['reactor'] ) ) { // WPCS: CSRF OK.
335
-			$this->unexpected_error( 'reactor' );
334
+		if ( ! isset($_POST['reactor'])) { // WPCS: CSRF OK.
335
+			$this->unexpected_error('reactor');
336 336
 		}
337 337
 
338
-		$reactor_slug = sanitize_key( $_POST['reactor'] ); // WPCS: CSRF OK.
338
+		$reactor_slug = sanitize_key($_POST['reactor']); // WPCS: CSRF OK.
339 339
 
340
-		$reactor = wordpoints_hooks()->reactors->get( $reactor_slug );
340
+		$reactor = wordpoints_hooks()->reactors->get($reactor_slug);
341 341
 
342
-		if ( ! $reactor instanceof WordPoints_Hook_Reactor ) {
343
-			$this->unexpected_error( 'reactor_invalid' );
342
+		if ( ! $reactor instanceof WordPoints_Hook_Reactor) {
343
+			$this->unexpected_error('reactor_invalid');
344 344
 		}
345 345
 
346 346
 		$this->reactor_slug = $reactor_slug;
@@ -358,16 +358,16 @@  discard block
 block discarded – undo
358 358
 	 */
359 359
 	protected function get_reaction() {
360 360
 
361
-		if ( ! isset( $_POST['id'] ) ) { // WPCS: CSRF OK.
362
-			$this->unexpected_error( 'id' );
361
+		if ( ! isset($_POST['id'])) { // WPCS: CSRF OK.
362
+			$this->unexpected_error('id');
363 363
 		}
364 364
 
365 365
 		$reaction = $this->reactor->reactions->get_reaction(
366
-			wordpoints_int( $_POST['id'] ) // WPCS: CSRF OK.
366
+			wordpoints_int($_POST['id']) // WPCS: CSRF OK.
367 367
 		);
368 368
 
369
-		if ( ! $reaction ) {
370
-			wp_send_json_error( array( 'message' => __( 'The reaction ID passed to the server is invalid. Perhaps it has been deleted. Try reloading the page.', 'wordpoints' ) ) );
369
+		if ( ! $reaction) {
370
+			wp_send_json_error(array('message' => __('The reaction ID passed to the server is invalid. Perhaps it has been deleted. Try reloading the page.', 'wordpoints')));
371 371
 		}
372 372
 
373 373
 		return $reaction;
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
 	 */
383 383
 	protected function get_data() {
384 384
 
385
-		$data = wp_unslash( $_POST ); // WPCS: CSRF OK.
385
+		$data = wp_unslash($_POST); // WPCS: CSRF OK.
386 386
 
387
-		unset( $data['id'], $data['action'], $data['nonce'], $data['reactor'] );
387
+		unset($data['id'], $data['action'], $data['nonce'], $data['reactor']);
388 388
 
389 389
 		return $data;
390 390
 	}
@@ -397,30 +397,30 @@  discard block
 block discarded – undo
397 397
 	 * @param mixed  $result The result of the action.
398 398
 	 * @param string $action The action being performed: 'create' or 'update'.
399 399
 	 */
400
-	private function send_json_result( $result, $action ) {
400
+	private function send_json_result($result, $action) {
401 401
 
402
-		if ( ! $result ) {
402
+		if ( ! $result) {
403 403
 
404
-			if ( 'create' === $action ) {
405
-				$message = __( 'There was an error adding the reaction. Please try again.', 'wordpoints' );
404
+			if ('create' === $action) {
405
+				$message = __('There was an error adding the reaction. Please try again.', 'wordpoints');
406 406
 			} else {
407
-				$message = __( 'There was an error updating the reaction. Please try again.', 'wordpoints' );
407
+				$message = __('There was an error updating the reaction. Please try again.', 'wordpoints');
408 408
 			}
409 409
 
410
-			wp_send_json_error( array( 'message' => $message ) );
410
+			wp_send_json_error(array('message' => $message));
411 411
 
412
-		} elseif ( $result instanceof WordPoints_Hook_Reaction_Validator ) {
412
+		} elseif ($result instanceof WordPoints_Hook_Reaction_Validator) {
413 413
 
414
-			wp_send_json_error( array( 'errors' => $result->get_errors() ) );
414
+			wp_send_json_error(array('errors' => $result->get_errors()));
415 415
 		}
416 416
 
417 417
 		$data = null;
418 418
 
419
-		if ( 'create' === $action ) {
420
-			$data = self::prepare_hook_reaction( $result );
419
+		if ('create' === $action) {
420
+			$data = self::prepare_hook_reaction($result);
421 421
 		}
422 422
 
423
-		wp_send_json_success( $data );
423
+		wp_send_json_success($data);
424 424
 	}
425 425
 }
426 426
 
Please login to merge, or discard this patch.
src/admin/includes/classes/screen/points/types.php 1 patch
Spacing   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * @since 1.0.0
57 57
 	 */
58 58
 	protected function get_title() {
59
-		return _x( 'Points Types', 'page title', 'wordpoints' );
59
+		return _x('Points Types', 'page title', 'wordpoints');
60 60
 	}
61 61
 
62 62
 	/**
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 
67 67
 		parent::hooks();
68 68
 
69
-		add_action( 'add_meta_boxes', array( $this, 'add_points_settings_meta_box' ) );
70
-		add_action( 'add_meta_boxes', array( $this, 'add_event_meta_boxes' ) );
69
+		add_action('add_meta_boxes', array($this, 'add_points_settings_meta_box'));
70
+		add_action('add_meta_boxes', array($this, 'add_event_meta_boxes'));
71 71
 	}
72 72
 
73 73
 	/**
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
 	 */
76 76
 	public function enqueue_scripts() {
77 77
 
78
-		wp_enqueue_style( 'wordpoints-hooks-admin' );
78
+		wp_enqueue_style('wordpoints-hooks-admin');
79 79
 
80
-		wp_enqueue_script( 'postbox' );
80
+		wp_enqueue_script('postbox');
81 81
 
82 82
 		wordpoints_hooks_ui_setup_script_data();
83 83
 	}
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 					.addClass( 'closed' );
98 98
 
99 99
 				postboxes.add_postbox_toggles(
100
-					<?php echo wp_json_encode( $this->id ); ?>
100
+					<?php echo wp_json_encode($this->id); ?>
101 101
 				);
102 102
 			} );
103 103
 		</script>
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	public function add_points_settings_meta_box() {
114 114
 
115
-		if ( ! current_user_can( 'manage_wordpoints_points_types' ) ) {
115
+		if ( ! current_user_can('manage_wordpoints_points_types')) {
116 116
 			return;
117 117
 		}
118 118
 
119 119
 		add_meta_box(
120 120
 			'settings'
121
-			, __( 'Settings', 'wordpoints' )
122
-			, array( $this, 'display_points_settings_meta_box' )
121
+			, __('Settings', 'wordpoints')
122
+			, array($this, 'display_points_settings_meta_box')
123 123
 			, $this->id
124 124
 			, 'side'
125 125
 			, 'default'
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 */
134 134
 	public function display_points_settings_meta_box() {
135 135
 
136
-		if ( ! current_user_can( 'manage_wordpoints_points_types' ) ) {
136
+		if ( ! current_user_can('manage_wordpoints_points_types')) {
137 137
 			return;
138 138
 		}
139 139
 
@@ -141,12 +141,12 @@  discard block
 block discarded – undo
141 141
 
142 142
 		$add_new = 0;
143 143
 
144
-		$points_type = wordpoints_get_points_type( $slug );
144
+		$points_type = wordpoints_get_points_type($slug);
145 145
 
146
-		if ( ! $points_type ) {
146
+		if ( ! $points_type) {
147 147
 
148 148
 			$points_type = array();
149
-			$add_new     = wp_create_nonce( 'wordpoints_add_new_points_type' );
149
+			$add_new     = wp_create_nonce('wordpoints_add_new_points_type');
150 150
 		}
151 151
 
152 152
 		$points_type = array_merge(
@@ -161,15 +161,15 @@  discard block
 block discarded – undo
161 161
 		?>
162 162
 
163 163
 		<form method="post">
164
-			<?php if ( $slug ) : ?>
164
+			<?php if ($slug) : ?>
165 165
 				<p>
166 166
 					<span class="wordpoints-points-slug">
167 167
 						<em>
168
-							<?php echo esc_html( sprintf( __( 'Slug: %s', 'wordpoints' ), $slug ) ); ?>
168
+							<?php echo esc_html(sprintf(__('Slug: %s', 'wordpoints'), $slug)); ?>
169 169
 						</em>
170 170
 					</span>
171 171
 				</p>
172
-				<?php wp_nonce_field( "wordpoints_update_points_type-$slug", 'update_points_type' ); ?>
172
+				<?php wp_nonce_field("wordpoints_update_points_type-$slug", 'update_points_type'); ?>
173 173
 			<?php endif; ?>
174 174
 
175 175
 			<?php
@@ -183,45 +183,45 @@  discard block
 block discarded – undo
183 183
 			 *
184 184
 			 * @param string $points_type The slug of the points type.
185 185
 			 */
186
-			do_action( 'wordpoints_points_type_form_top', $slug );
186
+			do_action('wordpoints_points_type_form_top', $slug);
187 187
 
188
-			if ( $add_new ) {
188
+			if ($add_new) {
189 189
 
190 190
 				// Mark the prefix and suffix optional on the add new form.
191
-				$prefix = _x( 'Prefix (optional):', 'points type', 'wordpoints' );
192
-				$suffix = _x( 'Suffix (optional):', 'points type', 'wordpoints' );
191
+				$prefix = _x('Prefix (optional):', 'points type', 'wordpoints');
192
+				$suffix = _x('Suffix (optional):', 'points type', 'wordpoints');
193 193
 
194 194
 			} else {
195 195
 
196
-				$prefix = _x( 'Prefix:', 'points type', 'wordpoints' );
197
-				$suffix = _x( 'Suffix:', 'points type', 'wordpoints' );
196
+				$prefix = _x('Prefix:', 'points type', 'wordpoints');
197
+				$suffix = _x('Suffix:', 'points type', 'wordpoints');
198 198
 			}
199 199
 
200 200
 			?>
201 201
 
202 202
 			<p>
203 203
 				<label
204
-					for="points-name-<?php echo esc_attr( $slug ); ?>"><?php echo esc_html_x( 'Name:', 'points type', 'wordpoints' ); ?></label>
204
+					for="points-name-<?php echo esc_attr($slug); ?>"><?php echo esc_html_x('Name:', 'points type', 'wordpoints'); ?></label>
205 205
 				<input class="widefat" type="text"
206
-				       id="points-name-<?php echo esc_attr( $slug ); ?>"
206
+				       id="points-name-<?php echo esc_attr($slug); ?>"
207 207
 				       name="points-name"
208
-				       value="<?php echo esc_attr( $points_type['name'] ); ?>"/>
208
+				       value="<?php echo esc_attr($points_type['name']); ?>"/>
209 209
 			</p>
210 210
 			<p>
211 211
 				<label
212
-					for="points-prefix-<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $prefix ); ?></label>
212
+					for="points-prefix-<?php echo esc_attr($slug); ?>"><?php echo esc_html($prefix); ?></label>
213 213
 				<input class="widefat" type="text"
214
-				       id="points-prefix-<?php echo esc_attr( $slug ); ?>"
214
+				       id="points-prefix-<?php echo esc_attr($slug); ?>"
215 215
 				       name="points-prefix"
216
-				       value="<?php echo esc_attr( $points_type['prefix'] ); ?>"/>
216
+				       value="<?php echo esc_attr($points_type['prefix']); ?>"/>
217 217
 			</p>
218 218
 			<p>
219 219
 				<label
220
-					for="points-suffix-<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $suffix ); ?></label>
220
+					for="points-suffix-<?php echo esc_attr($slug); ?>"><?php echo esc_html($suffix); ?></label>
221 221
 				<input class="widefat" type="text"
222
-				       id="points-suffix-<?php echo esc_attr( $slug ); ?>"
222
+				       id="points-suffix-<?php echo esc_attr($slug); ?>"
223 223
 				       name="points-suffix"
224
-				       value="<?php echo esc_attr( $points_type['suffix'] ); ?>"/>
224
+				       value="<?php echo esc_attr($points_type['suffix']); ?>"/>
225 225
 			</p>
226 226
 
227 227
 			<?php
@@ -235,28 +235,28 @@  discard block
 block discarded – undo
235 235
 			 *
236 236
 			 * @param string $points_type The slug of the points type.
237 237
 			 */
238
-			do_action( 'wordpoints_points_type_form_bottom', $slug );
238
+			do_action('wordpoints_points_type_form_bottom', $slug);
239 239
 
240 240
 			?>
241 241
 
242 242
 			<input type="hidden" name="points-slug"
243
-			       value="<?php echo esc_attr( $slug ); ?>"/>
243
+			       value="<?php echo esc_attr($slug); ?>"/>
244 244
 			<input type="hidden" name="add_new" class="add_new"
245
-			       value="<?php echo esc_attr( $add_new ); ?>"/>
245
+			       value="<?php echo esc_attr($add_new); ?>"/>
246 246
 
247 247
 			<div class="hook-control-actions">
248 248
 				<div class="alignleft">
249 249
 					<?php
250 250
 
251
-					if ( ! $add_new ) {
252
-						wp_nonce_field( "wordpoints_delete_points_type-{$slug}", 'delete-points-type-nonce' );
253
-						submit_button( _x( 'Delete', 'points type', 'wordpoints' ), 'delete', 'delete-points-type', false, array( 'id' => "delete_points_type-{$slug}" ) );
251
+					if ( ! $add_new) {
252
+						wp_nonce_field("wordpoints_delete_points_type-{$slug}", 'delete-points-type-nonce');
253
+						submit_button(_x('Delete', 'points type', 'wordpoints'), 'delete', 'delete-points-type', false, array('id' => "delete_points_type-{$slug}"));
254 254
 					}
255 255
 
256 256
 					?>
257 257
 				</div>
258 258
 				<div class="alignright">
259
-					<?php submit_button( _x( 'Save', 'points type', 'wordpoints' ), 'button-primary hook-control-save right', 'save-points-type', false, array( 'id' => "points-{$slug}-save" ) ); ?>
259
+					<?php submit_button(_x('Save', 'points type', 'wordpoints'), 'button-primary hook-control-save right', 'save-points-type', false, array('id' => "points-{$slug}-save")); ?>
260 260
 					<span class="spinner"></span>
261 261
 				</div>
262 262
 				<br class="clear"/>
@@ -273,17 +273,17 @@  discard block
 block discarded – undo
273 273
 	 */
274 274
 	public function add_event_meta_boxes() {
275 275
 
276
-		if ( ! $this->current_points_type ) {
276
+		if ( ! $this->current_points_type) {
277 277
 			return;
278 278
 		}
279 279
 
280 280
 		/** @var WordPoints_Hook_EventI $event */
281
-		foreach ( $this->hooks->events->get_all() as $slug => $event ) {
281
+		foreach ($this->hooks->events->get_all() as $slug => $event) {
282 282
 
283 283
 			add_meta_box(
284 284
 				"{$this->current_points_type}-{$slug}"
285 285
 				, $event->get_title()
286
-				, array( $this, 'display_event_meta_box' )
286
+				, array($this, 'display_event_meta_box')
287 287
 				, $this->id
288 288
 				, 'events'
289 289
 				, 'default'
@@ -304,55 +304,55 @@  discard block
 block discarded – undo
304 304
 	 * @param array $points_type The points type this meta-box relates to.
305 305
 	 * @param array $meta_box    The data the meta-box was created with.
306 306
 	 */
307
-	public function display_event_meta_box( $points_type, $meta_box ) {
307
+	public function display_event_meta_box($points_type, $meta_box) {
308 308
 
309 309
 		$event_slug = $meta_box['args']['slug'];
310 310
 
311 311
 		/** @var WordPoints_Hook_Reactor $points_reactor */
312
-		$points_reactor = $this->hooks->reactors->get( 'points' );
312
+		$points_reactor = $this->hooks->reactors->get('points');
313 313
 
314 314
 		$data = array();
315 315
 
316
-		foreach ( $points_reactor->reactions->get_reactions_to_event( $event_slug ) as $id => $reaction ) {
317
-			if ( $reaction->get_meta( 'points_type' ) === $this->current_points_type ) {
316
+		foreach ($points_reactor->reactions->get_reactions_to_event($event_slug) as $id => $reaction) {
317
+			if ($reaction->get_meta('points_type') === $this->current_points_type) {
318 318
 				$data[] = WordPoints_Admin_Ajax_Hooks::prepare_hook_reaction(
319 319
 					$reaction
320 320
 				);
321 321
 			}
322 322
 		}
323 323
 
324
-		$args = $this->hooks->events->args->get_children( $event_slug );
324
+		$args = $this->hooks->events->args->get_children($event_slug);
325 325
 
326
-		$event_data = array( 'args' => array() );
326
+		$event_data = array('args' => array());
327 327
 
328
-		foreach ( $args as $slug => $arg ) {
328
+		foreach ($args as $slug => $arg) {
329 329
 
330
-			$event_data['args'][ $slug ] = array(
330
+			$event_data['args'][$slug] = array(
331 331
 				'slug' => $slug,
332 332
 			);
333 333
 
334
-			if ( $arg instanceof WordPoints_Hook_Arg ) {
335
-				$event_data['args'][ $slug ]['title'] = $arg->get_title();
336
-				$event_data['args'][ $slug ]['is_stateful'] = $arg->is_stateful();
334
+			if ($arg instanceof WordPoints_Hook_Arg) {
335
+				$event_data['args'][$slug]['title'] = $arg->get_title();
336
+				$event_data['args'][$slug]['is_stateful'] = $arg->is_stateful();
337 337
 			}
338 338
 		}
339 339
 
340 340
 		?>
341 341
 
342 342
 		<script>
343
-			WordPointsHooksAdminData.events[<?php echo wp_json_encode( $event_slug ); ?>] = <?php echo wp_json_encode( $event_data ); ?>;
344
-			WordPointsHooksAdminData.reactions[<?php echo wp_json_encode( $event_slug ); ?>] = <?php echo wp_json_encode( $data ); ?>;
343
+			WordPointsHooksAdminData.events[<?php echo wp_json_encode($event_slug); ?>] = <?php echo wp_json_encode($event_data); ?>;
344
+			WordPointsHooksAdminData.reactions[<?php echo wp_json_encode($event_slug); ?>] = <?php echo wp_json_encode($data); ?>;
345 345
 		</script>
346 346
 
347 347
 		<div class="wordpoints-hook-reaction-group-container">
348 348
 			<p class="description wordpoints-hook-reaction-group-description">
349
-				<?php echo esc_html( $meta_box['args']['event']->get_description() ); ?>
349
+				<?php echo esc_html($meta_box['args']['event']->get_description()); ?>
350 350
 			</p>
351 351
 
352 352
 			<div class="wordpoints-hook-reaction-group"
353
-				data-wordpoints-hooks-hook-event="<?php echo esc_attr( $event_slug ); ?>"
354
-				data-wordpoints-hooks-points-type="<?php echo esc_attr( $this->current_points_type ); ?>"
355
-				data-wordpoints-hooks-create-nonce="<?php echo esc_attr( WordPoints_Admin_Ajax_Hooks::get_create_nonce( $points_reactor ) ); ?>"
353
+				data-wordpoints-hooks-hook-event="<?php echo esc_attr($event_slug); ?>"
354
+				data-wordpoints-hooks-points-type="<?php echo esc_attr($this->current_points_type); ?>"
355
+				data-wordpoints-hooks-create-nonce="<?php echo esc_attr(WordPoints_Admin_Ajax_Hooks::get_create_nonce($points_reactor)); ?>"
356 356
 				data-wordpoints-hooks-reactor="points">
357 357
 			</div>
358 358
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 
367 367
 			<div class="controls">
368 368
 				<button type="button" class="button-primary add-reaction">
369
-					<?php esc_html_e( 'Add New', 'wordpoints' ); ?>
369
+					<?php esc_html_e('Add New', 'wordpoints'); ?>
370 370
 				</button>
371 371
 			</div>
372 372
 		</div>
@@ -386,19 +386,19 @@  discard block
 block discarded – undo
386 386
 		// Show a tab for each points type.
387 387
 		$tabs = array();
388 388
 
389
-		foreach ( $points_types as $slug => $settings ) {
390
-			$tabs[ $slug ] = $settings['name'];
389
+		foreach ($points_types as $slug => $settings) {
390
+			$tabs[$slug] = $settings['name'];
391 391
 		}
392 392
 
393
-		$tabs['add-new'] = __( 'Add New', 'wordpoints' );
393
+		$tabs['add-new'] = __('Add New', 'wordpoints');
394 394
 
395
-		$tab = wordpoints_admin_get_current_tab( $tabs );
395
+		$tab = wordpoints_admin_get_current_tab($tabs);
396 396
 
397
-		if ( 'add-new' !== $tab ) {
397
+		if ('add-new' !== $tab) {
398 398
 			$this->current_points_type = $tab;
399 399
 		}
400 400
 
401
-		do_action( 'add_meta_boxes', $this->id );
401
+		do_action('add_meta_boxes', $this->id);
402 402
 
403 403
 		$this->tabs = $tabs;
404 404
 	}
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 */
411 411
 	public function save_points_type() {
412 412
 
413
-		if ( ! current_user_can( 'manage_wordpoints_points_types' ) ) {
413
+		if ( ! current_user_can('manage_wordpoints_points_types')) {
414 414
 			return;
415 415
 		}
416 416
 
@@ -425,43 +425,43 @@  discard block
 block discarded – undo
425 425
 
426 426
 			$settings = array();
427 427
 
428
-			$settings['name']   = trim( sanitize_text_field( wp_unslash( $_POST['points-name'] ) ) ); // WPCS: CSRF OK
429
-			$settings['prefix'] = ltrim( sanitize_text_field( wp_unslash( $_POST['points-prefix'] ) ) ); // WPCS: CSRF OK
430
-			$settings['suffix'] = rtrim( sanitize_text_field( wp_unslash( $_POST['points-suffix'] ) ) ); // WPCS: CSRF OK
428
+			$settings['name']   = trim(sanitize_text_field(wp_unslash($_POST['points-name']))); // WPCS: CSRF OK
429
+			$settings['prefix'] = ltrim(sanitize_text_field(wp_unslash($_POST['points-prefix']))); // WPCS: CSRF OK
430
+			$settings['suffix'] = rtrim(sanitize_text_field(wp_unslash($_POST['points-suffix']))); // WPCS: CSRF OK
431 431
 
432 432
 			if (
433
-				isset( $_POST['points-slug'] )
434
-				&& wordpoints_verify_nonce( 'update_points_type', 'wordpoints_update_points_type-%s', array( 'points-slug' ), 'post' )
433
+				isset($_POST['points-slug'])
434
+				&& wordpoints_verify_nonce('update_points_type', 'wordpoints_update_points_type-%s', array('points-slug'), 'post')
435 435
 			) {
436 436
 
437 437
 				// - We are updating an existing points type.
438 438
 
439
-				$points_type = sanitize_key( $_POST['points-slug'] );
439
+				$points_type = sanitize_key($_POST['points-slug']);
440 440
 
441
-				$old_settings = wordpoints_get_points_type( $points_type );
441
+				$old_settings = wordpoints_get_points_type($points_type);
442 442
 
443
-				if ( false === $old_settings ) {
443
+				if (false === $old_settings) {
444 444
 
445 445
 					add_settings_error(
446 446
 						''
447 447
 						, 'wordpoints_points_type_update'
448
-						, __( 'Error: failed updating points type.', 'wordpoints' )
448
+						, __('Error: failed updating points type.', 'wordpoints')
449 449
 						, 'updated'
450 450
 					);
451 451
 
452 452
 					return;
453 453
 				}
454 454
 
455
-				if ( is_array( $old_settings ) ) {
456
-					$settings = array_merge( $old_settings, $settings );
455
+				if (is_array($old_settings)) {
456
+					$settings = array_merge($old_settings, $settings);
457 457
 				}
458 458
 
459
-				if ( ! wordpoints_update_points_type( $points_type, $settings ) ) {
459
+				if ( ! wordpoints_update_points_type($points_type, $settings)) {
460 460
 
461 461
 					add_settings_error(
462 462
 						''
463 463
 						, 'wordpoints_points_type_update'
464
-						, __( 'Error: failed updating points type.', 'wordpoints' )
464
+						, __('Error: failed updating points type.', 'wordpoints')
465 465
 						, 'updated'
466 466
 					);
467 467
 
@@ -470,23 +470,23 @@  discard block
 block discarded – undo
470 470
 					add_settings_error(
471 471
 						''
472 472
 						, 'wordpoints_points_type_update'
473
-						, __( 'Points type updated.', 'wordpoints' )
473
+						, __('Points type updated.', 'wordpoints')
474 474
 						, 'updated'
475 475
 					);
476 476
 				}
477 477
 
478
-			} elseif ( wordpoints_verify_nonce( 'add_new', 'wordpoints_add_new_points_type', null, 'post' ) ) {
478
+			} elseif (wordpoints_verify_nonce('add_new', 'wordpoints_add_new_points_type', null, 'post')) {
479 479
 
480 480
 				// - We are creating a new points type.
481 481
 
482
-				$slug = wordpoints_add_points_type( $settings );
482
+				$slug = wordpoints_add_points_type($settings);
483 483
 
484
-				if ( ! $slug ) {
484
+				if ( ! $slug) {
485 485
 
486 486
 					add_settings_error(
487 487
 						''
488 488
 						, 'wordpoints_points_type_create'
489
-						, __( 'Please choose a unique name for this points type.', 'wordpoints' )
489
+						, __('Please choose a unique name for this points type.', 'wordpoints')
490 490
 					);
491 491
 
492 492
 				} else {
@@ -496,26 +496,26 @@  discard block
 block discarded – undo
496 496
 					add_settings_error(
497 497
 						''
498 498
 						, 'wordpoints_points_type_create'
499
-						, __( 'Points type created.', 'wordpoints' )
499
+						, __('Points type created.', 'wordpoints')
500 500
 						, 'updated'
501 501
 					);
502 502
 				}
503 503
 			}
504 504
 
505 505
 		} elseif (
506
-			! empty( $_POST['delete-points-type'] )
507
-			&& isset( $_POST['points-slug'] )
508
-			&& wordpoints_verify_nonce( 'delete-points-type-nonce', 'wordpoints_delete_points_type-%s', array( 'points-slug' ), 'post' )
506
+			! empty($_POST['delete-points-type'])
507
+			&& isset($_POST['points-slug'])
508
+			&& wordpoints_verify_nonce('delete-points-type-nonce', 'wordpoints_delete_points_type-%s', array('points-slug'), 'post')
509 509
 		) {
510 510
 
511 511
 			// - We are deleting a points type.
512 512
 
513
-			if ( wordpoints_delete_points_type( sanitize_key( $_POST['points-slug'] ) ) ) {
513
+			if (wordpoints_delete_points_type(sanitize_key($_POST['points-slug']))) {
514 514
 
515 515
 				add_settings_error(
516 516
 					''
517 517
 					, 'wordpoints_points_type_delete'
518
-					, __( 'Points type deleted.', 'wordpoints' )
518
+					, __('Points type deleted.', 'wordpoints')
519 519
 					, 'updated'
520 520
 				);
521 521
 
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 				add_settings_error(
525 525
 					''
526 526
 					, 'wordpoints_points_type_delete'
527
-					, __( 'Error while deleting.', 'wordpoints' )
527
+					, __('Error while deleting.', 'wordpoints')
528 528
 				);
529 529
 			}
530 530
 		}
@@ -540,25 +540,25 @@  discard block
 block discarded – undo
540 540
 		 *
541 541
 		 * @since 1.0.0
542 542
 		 */
543
-		do_action( 'wordpoints_admin_points_events_head' );
543
+		do_action('wordpoints_admin_points_events_head');
544 544
 
545
-		if ( is_network_admin() ) {
546
-			$title = __( 'Network Events', 'wordpoints' );
547
-			$description = __( 'Award points when various events happen on this network.', 'wordpoints' );
545
+		if (is_network_admin()) {
546
+			$title = __('Network Events', 'wordpoints');
547
+			$description = __('Award points when various events happen on this network.', 'wordpoints');
548 548
 		} else {
549
-			$title = __( 'Events', 'wordpoints' );
550
-			$description = __( 'Award points when various events happen on this site.', 'wordpoints' );
549
+			$title = __('Events', 'wordpoints');
550
+			$description = __('Award points when various events happen on this site.', 'wordpoints');
551 551
 		}
552 552
 
553
-		$points_type = wordpoints_get_points_type( $this->current_points_type );
553
+		$points_type = wordpoints_get_points_type($this->current_points_type);
554 554
 
555 555
 		?>
556 556
 
557 557
 		<div class="wordpoints-points-type-meta-box-wrap">
558 558
 
559 559
 				<form>
560
-					<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
561
-					<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
560
+					<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
561
+					<?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?>
562 562
 				</form>
563 563
 
564 564
 				<div id="poststuff">
@@ -566,17 +566,17 @@  discard block
 block discarded – undo
566 566
 					<div id="post-body" class="metabox-holder columns-<?php echo 1 === (int) get_current_screen()->get_columns() ? '1' : '2'; ?>">
567 567
 
568 568
 						<div id="postbox-container-1" class="postbox-container">
569
-							<?php do_meta_boxes( $this->id, 'side', $points_type ); ?>
569
+							<?php do_meta_boxes($this->id, 'side', $points_type); ?>
570 570
 						</div>
571 571
 
572
-						<?php if ( isset( $this->current_points_type ) ) : ?>
572
+						<?php if (isset($this->current_points_type)) : ?>
573 573
 							<div class="wordpoints-hook-events-heading">
574
-								<h2><?php echo esc_html( $title ); ?></h2>
575
-								<p class="description"><?php echo esc_html( $description ); ?></p>
574
+								<h2><?php echo esc_html($title); ?></h2>
575
+								<p class="description"><?php echo esc_html($description); ?></p>
576 576
 							</div>
577 577
 
578 578
 							<div id="postbox-container-2" class="postbox-container">
579
-								<?php do_meta_boxes( $this->id, 'events', $points_type ); ?>
579
+								<?php do_meta_boxes($this->id, 'events', $points_type); ?>
580 580
 							</div>
581 581
 						<?php endif; ?>
582 582
 
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 		 *
596 596
 		 * @since 1.0.0
597 597
 		 */
598
-		do_action( 'wordpoints_admin_points_events_foot' );
598
+		do_action('wordpoints_admin_points_events_foot');
599 599
 	}
600 600
 }
601 601
 
Please login to merge, or discard this patch.
src/includes/classes/hook/reaction/store.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@
 block discarded – undo
179 179
 	 *
180 180
 	 * @param string $event_slug The slug of the event this reaction is for.
181 181
 	 *
182
-	 * @return int|false The reaction ID, or false if not created.
182
+	 * @return integer The reaction ID, or false if not created.
183 183
 	 */
184 184
 	abstract protected function _create_reaction( $event_slug );
185 185
 }
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	/**
61 61
 	 * @since 1.0.0
62 62
 	 */
63
-	public function __construct( $slug, WordPoints_Hook_Reactor $reactor ) {
63
+	public function __construct($slug, WordPoints_Hook_Reactor $reactor) {
64 64
 
65 65
 		$this->slug = $slug;
66 66
 		$this->reactor = $reactor;
@@ -84,33 +84,33 @@  discard block
 block discarded – undo
84 84
 	 * @since 1.0.0
85 85
 	 */
86 86
 	public function get_context_id() {
87
-		return wordpoints_entities_get_current_context_id( $this->context );
87
+		return wordpoints_entities_get_current_context_id($this->context);
88 88
 	}
89 89
 
90 90
 	/**
91 91
 	 * @since 1.0.0
92 92
 	 */
93
-	public function get_reaction( $id ) {
93
+	public function get_reaction($id) {
94 94
 
95
-		if ( ! $this->reaction_exists( $id ) ) {
95
+		if ( ! $this->reaction_exists($id)) {
96 96
 			return false;
97 97
 		}
98 98
 
99
-		return new $this->reaction_class( $id, $this );
99
+		return new $this->reaction_class($id, $this);
100 100
 	}
101 101
 
102 102
 	/**
103 103
 	 * @since 1.0.0
104 104
 	 */
105
-	public function create_reaction( array $settings ) {
106
-		return $this->create_or_update_reaction( $settings );
105
+	public function create_reaction(array $settings) {
106
+		return $this->create_or_update_reaction($settings);
107 107
 	}
108 108
 
109 109
 	/**
110 110
 	 * @since 1.0.0
111 111
 	 */
112
-	public function update_reaction( $id, array $settings ) {
113
-		return $this->create_or_update_reaction( $settings, $id );
112
+	public function update_reaction($id, array $settings) {
113
+		return $this->create_or_update_reaction($settings, $id);
114 114
 	}
115 115
 
116 116
 	/**
@@ -125,41 +125,41 @@  discard block
 block discarded – undo
125 125
 	 *         The reaction object if created/updated successfully. False or a
126 126
 	 *         validator instance if not.
127 127
 	 */
128
-	protected function create_or_update_reaction( array $settings, $id = null ) {
128
+	protected function create_or_update_reaction(array $settings, $id = null) {
129 129
 
130
-		$is_new = ! isset( $id );
130
+		$is_new = ! isset($id);
131 131
 
132
-		if ( ! $is_new && ! $this->reaction_exists( $id ) ) {
132
+		if ( ! $is_new && ! $this->reaction_exists($id)) {
133 133
 			return false;
134 134
 		}
135 135
 
136
-		$validator = new WordPoints_Hook_Reaction_Validator( $settings, $this->reactor );
136
+		$validator = new WordPoints_Hook_Reaction_Validator($settings, $this->reactor);
137 137
 		$settings = $validator->validate();
138 138
 
139
-		if ( $validator->had_errors() ) {
139
+		if ($validator->had_errors()) {
140 140
 			return $validator;
141 141
 		}
142 142
 
143
-		if ( $is_new ) {
143
+		if ($is_new) {
144 144
 
145
-			$id = $this->_create_reaction( $settings['event'] );
145
+			$id = $this->_create_reaction($settings['event']);
146 146
 
147
-			if ( ! $id ) {
147
+			if ( ! $id) {
148 148
 				return false;
149 149
 			}
150 150
 		}
151 151
 
152
-		$reaction = $this->get_reaction( $id );
152
+		$reaction = $this->get_reaction($id);
153 153
 
154
-		$reaction->update_event_slug( $settings['event'] );
154
+		$reaction->update_event_slug($settings['event']);
155 155
 
156
-		unset( $settings['event'] );
156
+		unset($settings['event']);
157 157
 
158
-		$this->reactor->update_settings( $reaction, $settings );
158
+		$this->reactor->update_settings($reaction, $settings);
159 159
 
160 160
 		/** @var WordPoints_Hook_Extension $extension */
161
-		foreach ( wordpoints_hooks()->extensions->get_all() as $extension ) {
162
-			$extension->update_settings( $reaction, $settings );
161
+		foreach (wordpoints_hooks()->extensions->get_all() as $extension) {
162
+			$extension->update_settings($reaction, $settings);
163 163
 		}
164 164
 
165 165
 		/**
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 		 * @param array                     $settings The new settings for the reaction.
170 170
 		 * @param bool                      $is_new   Whether the reaction was just now created.
171 171
 		 */
172
-		do_action( 'wordpoints_hook_reaction_save', $reaction, $settings, $is_new );
172
+		do_action('wordpoints_hook_reaction_save', $reaction, $settings, $is_new);
173 173
 
174 174
 		return $reaction;
175 175
 	}
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	 *
187 187
 	 * @return int|false The reaction ID, or false if not created.
188 188
 	 */
189
-	abstract protected function _create_reaction( $event_slug );
189
+	abstract protected function _create_reaction($event_slug);
190 190
 }
191 191
 
192 192
 // EOF
Please login to merge, or discard this patch.
src/includes/actions.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -7,26 +7,26 @@
 block discarded – undo
7 7
  * @since 1.0.0
8 8
  */
9 9
 
10
-add_action( 'wordpoints_init_app-apps', 'wordpoints_apps_init' );
11
-add_action( 'wordpoints_init_app-entities', 'wordpoints_entities_app_init' );
10
+add_action('wordpoints_init_app-apps', 'wordpoints_apps_init');
11
+add_action('wordpoints_init_app-entities', 'wordpoints_entities_app_init');
12 12
 
13
-add_action( 'wordpoints_init_app_registry-apps-entities', 'wordpoints_entities_init' );
14
-add_action( 'wordpoints_init_app_registry-entities-contexts', 'wordpoints_entity_contexts_init' );
13
+add_action('wordpoints_init_app_registry-apps-entities', 'wordpoints_entities_init');
14
+add_action('wordpoints_init_app_registry-entities-contexts', 'wordpoints_entity_contexts_init');
15 15
 
16
-add_action( 'wordpoints_init_app_registry-apps-data_types', 'wordpoints_data_types_init' );
16
+add_action('wordpoints_init_app_registry-apps-data_types', 'wordpoints_data_types_init');
17 17
 
18
-add_action( 'wordpoints_init_app_registry-hooks-firers', 'wordpoints_hook_firers_init' );
19
-add_action( 'wordpoints_init_app_registry-hooks-events', 'wordpoints_hook_events_init' );
20
-add_action( 'wordpoints_init_app_registry-hooks-actions', 'wordpoints_hook_actions_init' );
21
-add_action( 'wordpoints_init_app_registry-hooks-reactors', 'wordpoints_hook_reactors_init' );
22
-add_action( 'wordpoints_init_app_registry-hooks-reaction_stores', 'wordpoints_hook_reaction_stores_init' );
23
-add_action( 'wordpoints_init_app_registry-hooks-extensions', 'wordpoints_hook_extension_init' );
24
-add_action( 'wordpoints_init_app_registry-hooks-conditions', 'wordpoints_hook_conditions_init' );
18
+add_action('wordpoints_init_app_registry-hooks-firers', 'wordpoints_hook_firers_init');
19
+add_action('wordpoints_init_app_registry-hooks-events', 'wordpoints_hook_events_init');
20
+add_action('wordpoints_init_app_registry-hooks-actions', 'wordpoints_hook_actions_init');
21
+add_action('wordpoints_init_app_registry-hooks-reactors', 'wordpoints_hook_reactors_init');
22
+add_action('wordpoints_init_app_registry-hooks-reaction_stores', 'wordpoints_hook_reaction_stores_init');
23
+add_action('wordpoints_init_app_registry-hooks-extensions', 'wordpoints_hook_extension_init');
24
+add_action('wordpoints_init_app_registry-hooks-conditions', 'wordpoints_hook_conditions_init');
25 25
 
26
-add_action( 'wordpoints_modules_loaded', 'wordpoints_init_hooks' );
26
+add_action('wordpoints_modules_loaded', 'wordpoints_init_hooks');
27 27
 
28
-add_action( 'init', 'wordpoints_hooks_api_add_global_cache_groups', 5 );
28
+add_action('init', 'wordpoints_hooks_api_add_global_cache_groups', 5);
29 29
 
30
-add_filter( 'wordpoints_user_can_view_points_log', 'wordpoints_hooks_user_can_view_points_log' );
30
+add_filter('wordpoints_user_can_view_points_log', 'wordpoints_hooks_user_can_view_points_log');
31 31
 
32 32
 // EOF
Please login to merge, or discard this patch.
src/includes/classes/hook/reaction.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,18 +35,18 @@
 block discarded – undo
35 35
 	/**
36 36
 	 * @since 1.0.0
37 37
 	 */
38
-	public function __construct( $id, WordPoints_Hook_Reaction_StoreI $store ) {
38
+	public function __construct($id, WordPoints_Hook_Reaction_StoreI $store) {
39 39
 
40
-		$this->ID    = wordpoints_int( $id );
40
+		$this->ID    = wordpoints_int($id);
41 41
 		$this->store = $store;
42 42
 	}
43 43
 
44 44
 	/**
45 45
 	 * @since 1.0.0
46 46
 	 */
47
-	public function __get( $var ) {
47
+	public function __get($var) {
48 48
 
49
-		if ( 'ID' === $var ) {
49
+		if ('ID' === $var) {
50 50
 			return $this->ID;
51 51
 		}
52 52
 
Please login to merge, or discard this patch.
src/includes/classes/hook/reaction/options.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 	 * @since 1.0.0
26 26
 	 */
27 27
 	public function get_event_slug() {
28
-		return $this->store->get_reaction_event_from_index( $this->ID );
28
+		return $this->store->get_reaction_event_from_index($this->ID);
29 29
 	}
30 30
 
31 31
 	/**
32 32
 	 * @since 1.0.0
33 33
 	 */
34
-	public function update_event_slug( $event_slug ) {
34
+	public function update_event_slug($event_slug) {
35 35
 		return $this->store->update_reaction_event_in_index(
36 36
 			$this->ID
37 37
 			, $event_slug
@@ -41,63 +41,63 @@  discard block
 block discarded – undo
41 41
 	/**
42 42
 	 * @since 1.0.0
43 43
 	 */
44
-	public function get_meta( $key ) {
44
+	public function get_meta($key) {
45 45
 
46 46
 		$settings = $this->get_settings();
47 47
 
48
-		if ( ! is_array( $settings ) || ! isset( $settings[ $key ] ) ) {
48
+		if ( ! is_array($settings) || ! isset($settings[$key])) {
49 49
 			return false;
50 50
 		}
51 51
 
52
-		return $settings[ $key ];
52
+		return $settings[$key];
53 53
 	}
54 54
 
55 55
 	/**
56 56
 	 * @since 1.0.0
57 57
 	 */
58
-	public function add_meta( $key, $value ) {
58
+	public function add_meta($key, $value) {
59 59
 
60 60
 		$settings = $this->get_settings();
61 61
 
62
-		if ( ! is_array( $settings ) || isset( $settings[ $key ] ) ) {
62
+		if ( ! is_array($settings) || isset($settings[$key])) {
63 63
 			return false;
64 64
 		}
65 65
 
66
-		$settings[ $key ] = $value;
66
+		$settings[$key] = $value;
67 67
 
68
-		return $this->update_settings( $settings );
68
+		return $this->update_settings($settings);
69 69
 	}
70 70
 
71 71
 	/**
72 72
 	 * @since 1.0.0
73 73
 	 */
74
-	public function update_meta( $key, $value ) {
74
+	public function update_meta($key, $value) {
75 75
 
76 76
 		$settings = $this->get_settings();
77 77
 
78
-		if ( ! is_array( $settings ) ) {
78
+		if ( ! is_array($settings)) {
79 79
 			return false;
80 80
 		}
81 81
 
82
-		$settings[ $key ] = $value;
82
+		$settings[$key] = $value;
83 83
 
84
-		return $this->update_settings( $settings );
84
+		return $this->update_settings($settings);
85 85
 	}
86 86
 
87 87
 	/**
88 88
 	 * @since 1.0.0
89 89
 	 */
90
-	public function delete_meta( $key ) {
90
+	public function delete_meta($key) {
91 91
 
92 92
 		$settings = $this->get_settings();
93 93
 
94
-		if ( ! is_array( $settings ) || ! isset( $settings[ $key ] ) ) {
94
+		if ( ! is_array($settings) || ! isset($settings[$key])) {
95 95
 			return false;
96 96
 		}
97 97
 
98
-		unset( $settings[ $key ] );
98
+		unset($settings[$key]);
99 99
 
100
-		return $this->update_settings( $settings );
100
+		return $this->update_settings($settings);
101 101
 	}
102 102
 
103 103
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	protected function get_settings() {
118 118
 
119 119
 		return $this->store->get_option(
120
-			$this->store->get_settings_option_name( $this->ID )
120
+			$this->store->get_settings_option_name($this->ID)
121 121
 		);
122 122
 	}
123 123
 
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 	 *
131 131
 	 * @return bool Whether the settings were updated successfully.
132 132
 	 */
133
-	protected function update_settings( $settings ) {
133
+	protected function update_settings($settings) {
134 134
 
135 135
 		return $this->store->update_option(
136
-			$this->store->get_settings_option_name( $this->ID )
136
+			$this->store->get_settings_option_name($this->ID)
137 137
 			, $settings
138 138
 		);
139 139
 	}
Please login to merge, or discard this patch.
src/includes/classes/hook/reaction/store/options.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -22,25 +22,25 @@  discard block
 block discarded – undo
22 22
 	/**
23 23
 	 * @since 1.0.0
24 24
 	 */
25
-	public function reaction_exists( $id ) {
26
-		return (bool) $this->get_option( $this->get_settings_option_name( $id ) );
25
+	public function reaction_exists($id) {
26
+		return (bool) $this->get_option($this->get_settings_option_name($id));
27 27
 	}
28 28
 
29 29
 	/**
30 30
 	 * @since 1.0.0
31 31
 	 */
32 32
 	public function get_reactions() {
33
-		return $this->create_reaction_objects( $this->get_reaction_index() );
33
+		return $this->create_reaction_objects($this->get_reaction_index());
34 34
 	}
35 35
 
36 36
 	/**
37 37
 	 * @since 1.0.0
38 38
 	 */
39
-	public function get_reactions_to_event( $event_slug ) {
39
+	public function get_reactions_to_event($event_slug) {
40 40
 
41 41
 		$index = $this->get_reaction_index();
42
-		$index = wp_list_filter( $index, array( 'event' => $event_slug ) );
43
-		return $this->create_reaction_objects( $index );
42
+		$index = wp_list_filter($index, array('event' => $event_slug));
43
+		return $this->create_reaction_objects($index);
44 44
 	}
45 45
 
46 46
 	/**
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	protected function get_reaction_index() {
61 61
 
62
-		$index = $this->get_option( $this->get_reaction_index_option_name() );
62
+		$index = $this->get_option($this->get_reaction_index_option_name());
63 63
 
64
-		if ( ! is_array( $index ) ) {
64
+		if ( ! is_array($index)) {
65 65
 			$index = array();
66 66
 		}
67 67
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 *
78 78
 	 * @return bool Whether the index was updated successfully.
79 79
 	 */
80
-	protected function update_reaction_index( $index ) {
80
+	protected function update_reaction_index($index) {
81 81
 
82 82
 		return $this->update_option(
83 83
 			$this->get_reaction_index_option_name()
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
 	 *
97 97
 	 * @return string|false The event slug, or false if not found.
98 98
 	 */
99
-	public function get_reaction_event_from_index( $id ) {
99
+	public function get_reaction_event_from_index($id) {
100 100
 
101 101
 		$index = $this->get_reaction_index();
102 102
 
103
-		if ( ! isset( $index[ $id ]['event'] ) ) {
103
+		if ( ! isset($index[$id]['event'])) {
104 104
 			return false;
105 105
 		}
106 106
 
107
-		return $index[ $id ]['event'];
107
+		return $index[$id]['event'];
108 108
 	}
109 109
 
110 110
 	/**
@@ -119,17 +119,17 @@  discard block
 block discarded – undo
119 119
 	 *
120 120
 	 * @return bool Whether the event was updated successfully.
121 121
 	 */
122
-	public function update_reaction_event_in_index( $id, $event ) {
122
+	public function update_reaction_event_in_index($id, $event) {
123 123
 
124 124
 		$index = $this->get_reaction_index();
125 125
 
126
-		if ( ! isset( $index[ $id ] ) ) {
126
+		if ( ! isset($index[$id])) {
127 127
 			return false;
128 128
 		}
129 129
 
130
-		$index[ $id ]['event'] = $event;
130
+		$index[$id]['event'] = $event;
131 131
 
132
-		return $this->update_reaction_index( $index );
132
+		return $this->update_reaction_index($index);
133 133
 	}
134 134
 
135 135
 	/**
@@ -141,15 +141,15 @@  discard block
 block discarded – undo
141 141
 	 *
142 142
 	 * @return WordPoints_Hook_Reaction_Options[] The objects for the reactions.
143 143
 	 */
144
-	protected function create_reaction_objects( $index ) {
144
+	protected function create_reaction_objects($index) {
145 145
 
146 146
 		$reactions = array();
147 147
 
148
-		foreach ( $index as $reaction ) {
148
+		foreach ($index as $reaction) {
149 149
 
150
-			$object = $this->get_reaction( $reaction['id'] );
150
+			$object = $this->get_reaction($reaction['id']);
151 151
 
152
-			if ( ! $object ) {
152
+			if ( ! $object) {
153 153
 				continue;
154 154
 			}
155 155
 
@@ -162,53 +162,53 @@  discard block
 block discarded – undo
162 162
 	/**
163 163
 	 * @since 1.0.0
164 164
 	 */
165
-	public function delete_reaction( $id ) {
165
+	public function delete_reaction($id) {
166 166
 
167
-		if ( ! $this->reaction_exists( $id ) ) {
167
+		if ( ! $this->reaction_exists($id)) {
168 168
 			return false;
169 169
 		}
170 170
 
171
-		$result = $this->delete_option( $this->get_settings_option_name( $id ) );
171
+		$result = $this->delete_option($this->get_settings_option_name($id));
172 172
 
173
-		if ( ! $result ) {
173
+		if ( ! $result) {
174 174
 			return false;
175 175
 		}
176 176
 
177 177
 		$index = $this->get_reaction_index();
178 178
 
179
-		unset( $index[ $id ] );
179
+		unset($index[$id]);
180 180
 
181
-		return $this->update_reaction_index( $index );
181
+		return $this->update_reaction_index($index);
182 182
 	}
183 183
 
184 184
 	/**
185 185
 	 * @since 1.0.0
186 186
 	 */
187
-	protected function _create_reaction( $event_slug ) {
187
+	protected function _create_reaction($event_slug) {
188 188
 
189 189
 		$index = $this->get_reaction_index();
190 190
 
191 191
 		$id = 1;
192 192
 
193 193
 		// TODO this is fragile when the newest reaction gets deleted.
194
-		if ( ! empty( $index ) ) {
195
-			$id = 1 + max( array_keys( $index ) );
194
+		if ( ! empty($index)) {
195
+			$id = 1 + max(array_keys($index));
196 196
 		}
197 197
 
198
-		$settings = array( 'event' => $event_slug );
198
+		$settings = array('event' => $event_slug);
199 199
 
200 200
 		$result = $this->add_option(
201
-			$this->get_settings_option_name( $id )
201
+			$this->get_settings_option_name($id)
202 202
 			, $settings
203 203
 		);
204 204
 
205
-		if ( ! $result ) {
205
+		if ( ! $result) {
206 206
 			return false;
207 207
 		}
208 208
 
209
-		$index[ $id ] = array( 'event' => $event_slug, 'id' => $id );
209
+		$index[$id] = array('event' => $event_slug, 'id' => $id);
210 210
 
211
-		if ( ! $this->update_reaction_index( $index ) ) {
211
+		if ( ! $this->update_reaction_index($index)) {
212 212
 			return false;
213 213
 		}
214 214
 
@@ -226,8 +226,8 @@  discard block
 block discarded – undo
226 226
 	 *
227 227
 	 * @return mixed The option value, or false.
228 228
 	 */
229
-	public function get_option( $name ) {
230
-		return get_option( $name );
229
+	public function get_option($name) {
230
+		return get_option($name);
231 231
 	}
232 232
 
233 233
 	/**
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
 	 *
241 241
 	 * @return bool Whether the option was added successfully.
242 242
 	 */
243
-	protected function add_option( $name, $value ) {
244
-		return add_option( $name, $value );
243
+	protected function add_option($name, $value) {
244
+		return add_option($name, $value);
245 245
 	}
246 246
 
247 247
 	/**
@@ -256,8 +256,8 @@  discard block
 block discarded – undo
256 256
 	 *
257 257
 	 * @return bool Whether the option was updated successfully.
258 258
 	 */
259
-	public function update_option( $name, $value ) {
260
-		return update_option( $name, $value );
259
+	public function update_option($name, $value) {
260
+		return update_option($name, $value);
261 261
 	}
262 262
 
263 263
 	/**
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 	 *
270 270
 	 * @return bool Whether the option was deleted successfully.
271 271
 	 */
272
-	protected function delete_option( $name ) {
273
-		return delete_option( $name );
272
+	protected function delete_option($name) {
273
+		return delete_option($name);
274 274
 	}
275 275
 
276 276
 	/**
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 	 *
283 283
 	 * @return string The name of the option where the settings are stored.
284 284
 	 */
285
-	public function get_settings_option_name( $id ) {
285
+	public function get_settings_option_name($id) {
286 286
 		return "wordpoints_{$this->reactor_slug}_hook_reaction-{$id}";
287 287
 	}
288 288
 
Please login to merge, or discard this patch.
src/includes/classes/hook/reaction/store/options/network.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,29 +22,29 @@
 block discarded – undo
22 22
 	/**
23 23
 	 * @since 1.0.0
24 24
 	 */
25
-	public function get_option( $name ) {
26
-		return get_site_option( $name );
25
+	public function get_option($name) {
26
+		return get_site_option($name);
27 27
 	}
28 28
 
29 29
 	/**
30 30
 	 * @since 1.0.0
31 31
 	 */
32
-	protected function add_option( $name, $value ) {
33
-		return add_site_option( $name, $value );
32
+	protected function add_option($name, $value) {
33
+		return add_site_option($name, $value);
34 34
 	}
35 35
 
36 36
 	/**
37 37
 	 * @since 1.0.0
38 38
 	 */
39
-	public function update_option( $name, $value ) {
40
-		return update_site_option( $name, $value );
39
+	public function update_option($name, $value) {
40
+		return update_site_option($name, $value);
41 41
 	}
42 42
 
43 43
 	/**
44 44
 	 * @since 1.0.0
45 45
 	 */
46
-	protected function delete_option( $name ) {
47
-		return delete_site_option( $name );
46
+	protected function delete_option($name) {
47
+		return delete_site_option($name);
48 48
 	}
49 49
 }
50 50
 
Please login to merge, or discard this patch.