Completed
Push — master ( 8ff377...a97d75 )
by J.D.
04:02
created
src/includes/classes/hook/router.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
 	/**
81 81
 	 * @since 1.0.0
82 82
 	 */
83
-	public function __call( $name, $args ) {
83
+	public function __call($name, $args) {
84 84
 
85
-		$this->route_action( $name, $args );
85
+		$this->route_action($name, $args);
86 86
 
87 87
 		// Return the first value, in case it is hooked to a filter.
88 88
 		$return = null;
89
-		if ( isset( $args[0] ) ) {
89
+		if (isset($args[0])) {
90 90
 			$return = $args[0];
91 91
 		}
92 92
 
@@ -103,9 +103,9 @@  discard block
 block discarded – undo
103 103
 	 *                     action name and the priority.
104 104
 	 * @param array  $args The args the action was fired with.
105 105
 	 */
106
-	protected function route_action( $name, $args ) {
106
+	protected function route_action($name, $args) {
107 107
 
108
-		if ( ! isset( $this->action_index[ $name ] ) ) {
108
+		if ( ! isset($this->action_index[$name])) {
109 109
 			return;
110 110
 		}
111 111
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 		// registry attempts to access the router in its own constructor. The result
114 114
 		// of attempting to do this before the router itself has been fully
115 115
 		// constructed is that the events registry gets null instead of the router.
116
-		if ( ! isset( $this->hooks ) ) {
116
+		if ( ! isset($this->hooks)) {
117 117
 
118 118
 			$hooks = wordpoints_hooks();
119 119
 
@@ -122,38 +122,38 @@  discard block
 block discarded – undo
122 122
 			$this->actions = $hooks->actions;
123 123
 		}
124 124
 
125
-		foreach ( $this->action_index[ $name ]['actions'] as $slug => $data ) {
125
+		foreach ($this->action_index[$name]['actions'] as $slug => $data) {
126 126
 
127
-			if ( ! isset( $this->event_index[ $slug ] ) ) {
127
+			if ( ! isset($this->event_index[$slug])) {
128 128
 				continue;
129 129
 			}
130 130
 
131
-			$action_object = $this->actions->get( $slug, $args, $data );
131
+			$action_object = $this->actions->get($slug, $args, $data);
132 132
 
133
-			if ( ! ( $action_object instanceof WordPoints_Hook_ActionI ) ) {
133
+			if ( ! ($action_object instanceof WordPoints_Hook_ActionI)) {
134 134
 				continue;
135 135
 			}
136 136
 
137
-			if ( ! $action_object->should_fire() ) {
137
+			if ( ! $action_object->should_fire()) {
138 138
 				continue;
139 139
 			}
140 140
 
141
-			foreach ( $this->event_index[ $slug ] as $type => $events ) {
142
-				foreach ( $events as $event_slug => $unused ) {
141
+			foreach ($this->event_index[$slug] as $type => $events) {
142
+				foreach ($events as $event_slug => $unused) {
143 143
 
144
-					if ( ! $this->events->is_registered( $event_slug ) ) {
144
+					if ( ! $this->events->is_registered($event_slug)) {
145 145
 						continue;
146 146
 					}
147 147
 
148
-					$event_args = $this->events->args->get_children( $event_slug, array( $action_object ) );
148
+					$event_args = $this->events->args->get_children($event_slug, array($action_object));
149 149
 
150
-					if ( empty( $event_args ) ) {
150
+					if (empty($event_args)) {
151 151
 						continue;
152 152
 					}
153 153
 
154
-					$event_args = new WordPoints_Hook_Event_Args( $event_args );
154
+					$event_args = new WordPoints_Hook_Event_Args($event_args);
155 155
 
156
-					$this->hooks->fire( $event_slug, $event_args, $type );
156
+					$this->hooks->fire($event_slug, $event_args, $type);
157 157
 				}
158 158
 			}
159 159
 		}
@@ -182,56 +182,56 @@  discard block
 block discarded – undo
182 182
 	 *        }
183 183
 	 * }
184 184
 	 */
185
-	public function add_action( $slug, array $args ) {
185
+	public function add_action($slug, array $args) {
186 186
 
187 187
 		$priority = 10;
188
-		if ( isset( $args['priority'] ) ) {
188
+		if (isset($args['priority'])) {
189 189
 			$priority = $args['priority'];
190 190
 		}
191 191
 
192
-		if ( ! isset( $args['action'] ) ) {
192
+		if ( ! isset($args['action'])) {
193 193
 			return;
194 194
 		}
195 195
 
196 196
 		$method = "{$args['action']},{$priority}";
197 197
 
198
-		$this->action_index[ $method ]['actions'][ $slug ] = array();
198
+		$this->action_index[$method]['actions'][$slug] = array();
199 199
 
200 200
 		$arg_number = 1;
201 201
 
202
-		if ( isset( $args['data'] ) ) {
202
+		if (isset($args['data'])) {
203 203
 
204
-			if ( isset( $args['data']['arg_index'] ) ) {
205
-				$arg_number = 1 + max( $args['data']['arg_index'] );
204
+			if (isset($args['data']['arg_index'])) {
205
+				$arg_number = 1 + max($args['data']['arg_index']);
206 206
 			}
207 207
 
208
-			if ( isset( $args['data']['requirements'] ) ) {
209
-				$requirements = 1 + max( array_keys( $args['data']['requirements'] ) );
208
+			if (isset($args['data']['requirements'])) {
209
+				$requirements = 1 + max(array_keys($args['data']['requirements']));
210 210
 
211
-				if ( $requirements > $arg_number ) {
211
+				if ($requirements > $arg_number) {
212 212
 					$arg_number = $requirements;
213 213
 				}
214 214
 			}
215 215
 
216
-			$this->action_index[ $method ]['actions'][ $slug ] = $args['data'];
216
+			$this->action_index[$method]['actions'][$slug] = $args['data'];
217 217
 		}
218 218
 
219
-		if ( isset( $args['arg_number'] ) ) {
219
+		if (isset($args['arg_number'])) {
220 220
 			$arg_number = $args['arg_number'];
221 221
 		}
222 222
 
223 223
 		// If this action is already being routed, and will have enough args, we
224 224
 		// don't need to hook to it again.
225 225
 		if (
226
-			isset( $this->action_index[ $method ]['arg_number'] )
227
-			&& $this->action_index[ $method ]['arg_number'] >= $arg_number
226
+			isset($this->action_index[$method]['arg_number'])
227
+			&& $this->action_index[$method]['arg_number'] >= $arg_number
228 228
 		) {
229 229
 			return;
230 230
 		}
231 231
 
232
-		$this->action_index[ $method ]['arg_number'] = $arg_number;
232
+		$this->action_index[$method]['arg_number'] = $arg_number;
233 233
 
234
-		add_action( $args['action'], array( $this, $method ), $priority, $arg_number );
234
+		add_action($args['action'], array($this, $method), $priority, $arg_number);
235 235
 	}
236 236
 
237 237
 	/**
@@ -241,20 +241,20 @@  discard block
 block discarded – undo
241 241
 	 *
242 242
 	 * @param string $slug The action slug.
243 243
 	 */
244
-	public function remove_action( $slug ) {
244
+	public function remove_action($slug) {
245 245
 
246
-		foreach ( $this->action_index as $method => $data ) {
247
-			if ( isset( $data['actions'][ $slug ] ) ) {
246
+		foreach ($this->action_index as $method => $data) {
247
+			if (isset($data['actions'][$slug])) {
248 248
 
249
-				unset( $this->action_index[ $method ]['actions'][ $slug ] );
249
+				unset($this->action_index[$method]['actions'][$slug]);
250 250
 
251
-				if ( empty( $this->action_index[ $method ]['actions'] ) ) {
251
+				if (empty($this->action_index[$method]['actions'])) {
252 252
 
253
-					unset( $this->action_index[ $method ] );
253
+					unset($this->action_index[$method]);
254 254
 
255
-					list( $action, $priority ) = explode( ',', $method );
255
+					list($action, $priority) = explode(',', $method);
256 256
 
257
-					remove_action( $action, array( $this, $method ), $priority );
257
+					remove_action($action, array($this, $method), $priority);
258 258
 				}
259 259
 			}
260 260
 		}
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
 	 * @param string $action_slug The slug of the action.
270 270
 	 * @param string $action_type The type of action. Default is 'fire'.
271 271
 	 */
272
-	public function add_event_to_action( $event_slug, $action_slug, $action_type = 'fire' ) {
273
-		$this->event_index[ $action_slug ][ $action_type ][ $event_slug ] = true;
272
+	public function add_event_to_action($event_slug, $action_slug, $action_type = 'fire') {
273
+		$this->event_index[$action_slug][$action_type][$event_slug] = true;
274 274
 	}
275 275
 
276 276
 	/**
@@ -282,8 +282,8 @@  discard block
 block discarded – undo
282 282
 	 * @param string $action_slug The slug of the action.
283 283
 	 * @param string $action_type The type of action. Default is 'fire'.
284 284
 	 */
285
-	public function remove_event_from_action( $event_slug, $action_slug, $action_type = 'fire' ) {
286
-		unset( $this->event_index[ $action_slug ][ $action_type ][ $event_slug ] );
285
+	public function remove_event_from_action($event_slug, $action_slug, $action_type = 'fire') {
286
+		unset($this->event_index[$action_slug][$action_type][$event_slug]);
287 287
 	}
288 288
 
289 289
 	/**
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
 	 */
296 296
 	public function get_event_index() {
297 297
 
298
-		if ( empty( $this->event_index ) ) {
298
+		if (empty($this->event_index)) {
299 299
 			wordpoints_hooks()->events;
300 300
 		}
301 301
 
Please login to merge, or discard this patch.
src/includes/classes/hook/reactor/points.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	/**
28 28
 	 * @since 1.0.0
29 29
 	 */
30
-	protected $action_types = array( 'fire', 'toggle_on', 'toggle_off' );
30
+	protected $action_types = array('fire', 'toggle_on', 'toggle_off');
31 31
 
32 32
 	/**
33 33
 	 * @since 1.0.0
@@ -58,9 +58,9 @@  discard block
 block discarded – undo
58 58
 	 */
59 59
 	public function get_settings_fields() {
60 60
 
61
-		$this->settings_fields['points']['label'] = _x( 'Points', 'form label', 'wordpoints' );
62
-		$this->settings_fields['log_text']['label'] = _x( 'Log Text', 'form label', 'wordpoints' );
63
-		$this->settings_fields['description']['label'] = _x( 'Description', 'form label', 'wordpoints' );
61
+		$this->settings_fields['points']['label'] = _x('Points', 'form label', 'wordpoints');
62
+		$this->settings_fields['log_text']['label'] = _x('Log Text', 'form label', 'wordpoints');
63
+		$this->settings_fields['description']['label'] = _x('Description', 'form label', 'wordpoints');
64 64
 
65 65
 		return parent::get_settings_fields();
66 66
 	}
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
 		$data = parent::get_ui_script_data();
74 74
 
75
-		$data['target_label'] = __( 'Award To', 'wordpoints' );
76
-		$data['periods_label'] = __( 'Award each user no more than once per:', 'wordpoints' );
75
+		$data['target_label'] = __('Award To', 'wordpoints');
76
+		$data['periods_label'] = __('Award each user no more than once per:', 'wordpoints');
77 77
 
78 78
 		return $data;
79 79
 	}
@@ -87,23 +87,23 @@  discard block
 block discarded – undo
87 87
 		WordPoints_Hook_Event_Args $event_args
88 88
 	) {
89 89
 
90
-		if ( ! isset( $settings['points'] ) || false === wordpoints_int( $settings['points'] ) ) {
91
-			$validator->add_error( __( 'Points must be an integer.', 'wordpoints' ), 'points' );
90
+		if ( ! isset($settings['points']) || false === wordpoints_int($settings['points'])) {
91
+			$validator->add_error(__('Points must be an integer.', 'wordpoints'), 'points');
92 92
 		}
93 93
 
94
-		if ( ! isset( $settings['points_type'] ) || ! wordpoints_is_points_type( $settings['points_type'] ) ) {
95
-			$validator->add_error( __( 'Invalid points type.', 'wordpoints' ), 'points_type' );
94
+		if ( ! isset($settings['points_type']) || ! wordpoints_is_points_type($settings['points_type'])) {
95
+			$validator->add_error(__('Invalid points type.', 'wordpoints'), 'points_type');
96 96
 		}
97 97
 
98
-		if ( ! isset( $settings['description'] ) ) {
99
-			$validator->add_error( __( 'Description is required.', 'wordpoints' ), 'description' );
98
+		if ( ! isset($settings['description'])) {
99
+			$validator->add_error(__('Description is required.', 'wordpoints'), 'description');
100 100
 		}
101 101
 
102
-		if ( ! isset( $settings['log_text'] ) ) {
103
-			$validator->add_error( __( 'Log Text is required.', 'wordpoints' ), 'log_text' );
102
+		if ( ! isset($settings['log_text'])) {
103
+			$validator->add_error(__('Log Text is required.', 'wordpoints'), 'log_text');
104 104
 		}
105 105
 
106
-		return parent::validate_settings( $settings, $validator, $event_args );
106
+		return parent::validate_settings($settings, $validator, $event_args);
107 107
 	}
108 108
 
109 109
 	/**
@@ -114,58 +114,58 @@  discard block
 block discarded – undo
114 114
 		array $settings
115 115
 	) {
116 116
 
117
-		parent::update_settings( $reaction, $settings );
117
+		parent::update_settings($reaction, $settings);
118 118
 
119
-		$reaction->update_meta( 'points', $settings['points'] );
120
-		$reaction->update_meta( 'points_type', $settings['points_type'] );
121
-		$reaction->update_meta( 'description', $settings['description'] );
122
-		$reaction->update_meta( 'log_text', $settings['log_text'] );
119
+		$reaction->update_meta('points', $settings['points']);
120
+		$reaction->update_meta('points_type', $settings['points_type']);
121
+		$reaction->update_meta('description', $settings['description']);
122
+		$reaction->update_meta('log_text', $settings['log_text']);
123 123
 	}
124 124
 
125 125
 	/**
126 126
 	 * @since 1.0.0
127 127
 	 */
128
-	public function hit( WordPoints_Hook_Fire $fire ) {
128
+	public function hit(WordPoints_Hook_Fire $fire) {
129 129
 
130
-		if ( 'toggle_off' === $fire->action_type ) {
131
-			$this->reverse_hit( $fire );
130
+		if ('toggle_off' === $fire->action_type) {
131
+			$this->reverse_hit($fire);
132 132
 			return;
133 133
 		}
134 134
 
135 135
 		$reaction = $fire->reaction;
136 136
 
137 137
 		$target = $fire->event_args->get_from_hierarchy(
138
-			$reaction->get_meta( 'target' )
138
+			$reaction->get_meta('target')
139 139
 		);
140 140
 
141
-		if ( ! $target instanceof WordPoints_Entity ) {
141
+		if ( ! $target instanceof WordPoints_Entity) {
142 142
 			return;
143 143
 		}
144 144
 
145
-		$meta = array( 'hook_hit_id' => $fire->hit_id );
145
+		$meta = array('hook_hit_id' => $fire->hit_id);
146 146
 
147
-		foreach ( $fire->event_args->get_entities() as $entity ) {
148
-			$meta[ $entity->get_slug() ] = $entity->get_the_id();
147
+		foreach ($fire->event_args->get_entities() as $entity) {
148
+			$meta[$entity->get_slug()] = $entity->get_the_id();
149 149
 		}
150 150
 
151 151
 		wordpoints_alter_points(
152 152
 			$target->get_the_id()
153
-			, $reaction->get_meta( 'points' )
154
-			, $reaction->get_meta( 'points_type' )
153
+			, $reaction->get_meta('points')
154
+			, $reaction->get_meta('points_type')
155 155
 			, $reaction->get_event_slug()
156 156
 			, $meta
157
-			, $reaction->get_meta( 'log_text' )
157
+			, $reaction->get_meta('log_text')
158 158
 		);
159 159
 	}
160 160
 
161 161
 	/**
162 162
 	 * @since 1.0.0
163 163
 	 */
164
-	public function reverse_hit( WordPoints_Hook_Fire $fire ) {
164
+	public function reverse_hit(WordPoints_Hook_Fire $fire) {
165 165
 
166
-		$hit_ids = $this->get_hit_ids_to_be_reversed( $fire );
166
+		$hit_ids = $this->get_hit_ids_to_be_reversed($fire);
167 167
 
168
-		if ( empty( $hit_ids ) ) {
168
+		if (empty($hit_ids)) {
169 169
 			return;
170 170
 		}
171 171
 
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
 
184 184
 		$logs = $query->get();
185 185
 
186
-		if ( ! $logs ) {
186
+		if ( ! $logs) {
187 187
 			return;
188 188
 		}
189 189
 
190
-		$this->reverse_logs( $logs, $fire );
190
+		$this->reverse_logs($logs, $fire);
191 191
 	}
192 192
 
193 193
 	/**
@@ -199,10 +199,10 @@  discard block
 block discarded – undo
199 199
 	 *
200 200
 	 * @return array The IDs of the hits to be reversed.
201 201
 	 */
202
-	protected function get_hit_ids_to_be_reversed( WordPoints_Hook_Fire $fire ) {
202
+	protected function get_hit_ids_to_be_reversed(WordPoints_Hook_Fire $fire) {
203 203
 
204 204
 		// We closely integrate with the reversals extension to get the hit IDs.
205
-		if ( ! isset( $fire->data['reversals']['hit_ids'] ) ) {
205
+		if ( ! isset($fire->data['reversals']['hit_ids'])) {
206 206
 			return array();
207 207
 		}
208 208
 
@@ -217,28 +217,28 @@  discard block
 block discarded – undo
217 217
 	 * @param object[]             $logs The logs to reverse.
218 218
 	 * @param WordPoints_Hook_Fire $fire The fire object.
219 219
 	 */
220
-	protected function reverse_logs( $logs, WordPoints_Hook_Fire $fire ) {
220
+	protected function reverse_logs($logs, WordPoints_Hook_Fire $fire) {
221 221
 
222 222
 		$event = wordpoints_hooks()->events->get(
223 223
 			$fire->reaction->get_event_slug()
224 224
 		);
225 225
 
226
-		if ( $event instanceof WordPoints_Hook_Event_ReversingI ) {
226
+		if ($event instanceof WordPoints_Hook_Event_ReversingI) {
227 227
 
228 228
 			/* translators: 1: log text for transaction that is being reversed, 2: the reason that this is being reversed. */
229
-			$template = __( 'Reversed “%1$s” (%2$s)', 'wordpoints' );
229
+			$template = __('Reversed “%1$s” (%2$s)', 'wordpoints');
230 230
 
231 231
 			$event_description = $event->get_reversal_text();
232 232
 
233 233
 		} else {
234 234
 
235 235
 			/* translators: 1: log text for transaction that is being reversed. */
236
-			$template = __( 'Reversed “%1$s”', 'wordpoints' );
236
+			$template = __('Reversed “%1$s”', 'wordpoints');
237 237
 
238 238
 			$event_description = '';
239 239
 		}
240 240
 
241
-		foreach ( $logs as $log ) {
241
+		foreach ($logs as $log) {
242 242
 
243 243
 			$log_id = wordpoints_alter_points(
244 244
 				$log->user_id
@@ -249,11 +249,11 @@  discard block
 block discarded – undo
249 249
 					'original_log_id' => $log->id,
250 250
 					'hook_hit_id'     => $fire->hit_id,
251 251
 				)
252
-				, sprintf( $template, $log->text, $event_description )
252
+				, sprintf($template, $log->text, $event_description)
253 253
 			);
254 254
 
255 255
 			// Mark the old log as reversed by this one.
256
-			wordpoints_update_points_log_meta( $log->id, 'auto_reversed', $log_id );
256
+			wordpoints_update_points_log_meta($log->id, 'auto_reversed', $log_id);
257 257
 		}
258 258
 	}
259 259
 }
Please login to merge, or discard this patch.
src/includes/classes/hook/reactor/points/legacy.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@  discard block
 block discarded – undo
27 27
 		array $settings
28 28
 	) {
29 29
 
30
-		if ( isset( $settings['legacy_log_type'] ) ) {
30
+		if (isset($settings['legacy_log_type'])) {
31 31
 			$reaction->update_meta(
32 32
 				'legacy_log_type',
33 33
 				$settings['legacy_log_type']
34 34
 			);
35 35
 		}
36 36
 
37
-		parent::update_settings( $reaction, $settings );
37
+		parent::update_settings($reaction, $settings);
38 38
 	}
39 39
 
40 40
 	/**
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 	/**
53 53
 	 * @since 1.0.0
54 54
 	 */
55
-	public function reverse_hit( WordPoints_Hook_Fire $fire ) {
55
+	public function reverse_hit(WordPoints_Hook_Fire $fire) {
56 56
 
57
-		if ( isset( $fire->data['reversals_legacy_points']['points_logs'] ) ) {
57
+		if (isset($fire->data['reversals_legacy_points']['points_logs'])) {
58 58
 
59 59
 			$this->reverse_logs(
60 60
 				$fire->data['reversals_legacy_points']['points_logs']
@@ -62,17 +62,17 @@  discard block
 block discarded – undo
62 62
 			);
63 63
 
64 64
 		} else {
65
-			parent::reverse_hit( $fire );
65
+			parent::reverse_hit($fire);
66 66
 		}
67 67
 	}
68 68
 
69 69
 	/**
70 70
 	 * @since 1.0.0
71 71
 	 */
72
-	protected function get_hit_ids_to_be_reversed( WordPoints_Hook_Fire $fire ) {
72
+	protected function get_hit_ids_to_be_reversed(WordPoints_Hook_Fire $fire) {
73 73
 
74 74
 		// We closely integrate with the legacy reversals extension to get the IDs.
75
-		if ( ! isset( $fire->data['reversals_legacy_points']['hit_ids'] ) ) {
75
+		if ( ! isset($fire->data['reversals_legacy_points']['hit_ids'])) {
76 76
 			return array();
77 77
 		}
78 78
 
Please login to merge, or discard this patch.
src/includes/classes/hook/event/media/upload.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	public function get_title() {
23 23
 
24
-		return __( 'Upload Media', 'wordpoints' );
24
+		return __('Upload Media', 'wordpoints');
25 25
 	}
26 26
 
27 27
 	/**
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function get_description() {
31 31
 
32
-		return __( 'When a file is uploaded to the Media Library.', 'wordpoints' );
32
+		return __('When a file is uploaded to the Media Library.', 'wordpoints');
33 33
 	}
34 34
 
35 35
 	/**
36 36
 	 * @since 1.0.0
37 37
 	 */
38 38
 	public function get_reversal_text() {
39
-		return __( 'Media file deleted.', 'wordpoints' );
39
+		return __('Media file deleted.', 'wordpoints');
40 40
 	}
41 41
 }
42 42
 
Please login to merge, or discard this patch.
src/includes/classes/hook/event/user/register.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,21 +20,21 @@
 block discarded – undo
20 20
 	 * @since 1.0.0
21 21
 	 */
22 22
 	public function get_title() {
23
-		return __( 'Register', 'wordpoints' );
23
+		return __('Register', 'wordpoints');
24 24
 	}
25 25
 
26 26
 	/**
27 27
 	 * @since 1.0.0
28 28
 	 */
29 29
 	public function get_description() {
30
-		return __( 'Registering.', 'wordpoints' );
30
+		return __('Registering.', 'wordpoints');
31 31
 	}
32 32
 
33 33
 	/**
34 34
 	 * @since 1.0.0
35 35
 	 */
36 36
 	public function get_reversal_text() {
37
-		return __( 'User removed.', 'wordpoints' );
37
+		return __('User removed.', 'wordpoints');
38 38
 	}
39 39
 }
40 40
 
Please login to merge, or discard this patch.
src/includes/classes/hook/event/post/publish.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -26,20 +26,20 @@  discard block
 block discarded – undo
26 26
 	 */
27 27
 	public function get_title() {
28 28
 
29
-		$parsed = wordpoints_parse_dynamic_slug( $this->slug );
29
+		$parsed = wordpoints_parse_dynamic_slug($this->slug);
30 30
 
31
-		switch ( $parsed['dynamic'] ) {
31
+		switch ($parsed['dynamic']) {
32 32
 
33 33
 			case 'post':
34
-				return __( 'Publish Post', 'wordpoints' );
34
+				return __('Publish Post', 'wordpoints');
35 35
 
36 36
 			case 'page':
37
-				return __( 'Publish Page', 'wordpoints' );
37
+				return __('Publish Page', 'wordpoints');
38 38
 
39 39
 			default:
40 40
 				return sprintf(
41 41
 					// translators: singular name of the post type
42
-					__( 'Publish %s', 'wordpoints' )
42
+					__('Publish %s', 'wordpoints')
43 43
 					, $this->get_entity_title()
44 44
 				);
45 45
 		}
@@ -50,20 +50,20 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	public function get_description() {
52 52
 
53
-		$parsed = wordpoints_parse_dynamic_slug( $this->slug );
53
+		$parsed = wordpoints_parse_dynamic_slug($this->slug);
54 54
 
55
-		switch ( $parsed['dynamic'] ) {
55
+		switch ($parsed['dynamic']) {
56 56
 
57 57
 			case 'post':
58
-				return __( 'When a Post is published.', 'wordpoints' );
58
+				return __('When a Post is published.', 'wordpoints');
59 59
 
60 60
 			case 'page':
61
-				return __( 'When a Page is published.', 'wordpoints' );
61
+				return __('When a Page is published.', 'wordpoints');
62 62
 
63 63
 			default:
64 64
 				return sprintf(
65 65
 					// translators: singular name of the post type
66
-					__( 'When a %s is published.', 'wordpoints' )
66
+					__('When a %s is published.', 'wordpoints')
67 67
 					, $this->get_entity_title()
68 68
 				);
69 69
 		}
@@ -74,20 +74,20 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function get_reversal_text() {
76 76
 		
77
-		$parsed = wordpoints_parse_dynamic_slug( $this->slug );
77
+		$parsed = wordpoints_parse_dynamic_slug($this->slug);
78 78
 
79
-		switch ( $parsed['dynamic'] ) {
79
+		switch ($parsed['dynamic']) {
80 80
 
81 81
 			case 'post':
82
-				return __( 'Post removed.', 'wordpoints' );
82
+				return __('Post removed.', 'wordpoints');
83 83
 
84 84
 			case 'page':
85
-				return __( 'Page removed.', 'wordpoints' );
85
+				return __('Page removed.', 'wordpoints');
86 86
 
87 87
 			default:
88 88
 				return sprintf(
89 89
 					// translators: singular name of the post type
90
-					_x( '%s removed.', 'post type', 'wordpoints' )
90
+					_x('%s removed.', 'post type', 'wordpoints')
91 91
 					, $this->get_entity_title()
92 92
 				);
93 93
 		}
Please login to merge, or discard this patch.
src/includes/classes/hook/event/comment/leave.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -26,23 +26,23 @@  discard block
 block discarded – undo
26 26
 	 */
27 27
 	public function get_title() {
28 28
 
29
-		$parsed = wordpoints_parse_dynamic_slug( $this->slug );
29
+		$parsed = wordpoints_parse_dynamic_slug($this->slug);
30 30
 
31
-		switch ( $parsed['dynamic'] ) {
31
+		switch ($parsed['dynamic']) {
32 32
 
33 33
 			case 'post':
34
-				return __( 'Comment on a Post', 'wordpoints' );
34
+				return __('Comment on a Post', 'wordpoints');
35 35
 
36 36
 			case 'page':
37
-				return __( 'Comment on a Page', 'wordpoints' );
37
+				return __('Comment on a Page', 'wordpoints');
38 38
 
39 39
 			case 'attachment':
40
-				return __( 'Comment on a Media Upload', 'wordpoints' );
40
+				return __('Comment on a Media Upload', 'wordpoints');
41 41
 
42 42
 			default:
43 43
 				return sprintf(
44 44
 					// translators: singular name of the post type
45
-					__( 'Comment on a %s', 'wordpoints' )
45
+					__('Comment on a %s', 'wordpoints')
46 46
 					, $this->get_entity_title()
47 47
 				);
48 48
 		}
@@ -53,23 +53,23 @@  discard block
 block discarded – undo
53 53
 	 */
54 54
 	public function get_description() {
55 55
 
56
-		$parsed = wordpoints_parse_dynamic_slug( $this->slug );
56
+		$parsed = wordpoints_parse_dynamic_slug($this->slug);
57 57
 
58
-		switch ( $parsed['dynamic'] ) {
58
+		switch ($parsed['dynamic']) {
59 59
 
60 60
 			case 'post':
61
-				return __( 'When a user leaves a comment on a Post.', 'wordpoints' );
61
+				return __('When a user leaves a comment on a Post.', 'wordpoints');
62 62
 
63 63
 			case 'page':
64
-				return __( 'When a user leaves a comment on a Page.', 'wordpoints' );
64
+				return __('When a user leaves a comment on a Page.', 'wordpoints');
65 65
 
66 66
 			case 'attachment':
67
-				return __( 'When a user leaves a comment on a file uploaded to the Media Library.', 'wordpoints' );
67
+				return __('When a user leaves a comment on a file uploaded to the Media Library.', 'wordpoints');
68 68
 
69 69
 			default:
70 70
 				return sprintf(
71 71
 					// translators: singular name of the post type
72
-					__( 'When a user leaves a comment on a %s.', 'wordpoints' )
72
+					__('When a user leaves a comment on a %s.', 'wordpoints')
73 73
 					, $this->get_entity_title()
74 74
 				);
75 75
 		}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 * @since 1.0.0
80 80
 	 */
81 81
 	public function get_reversal_text() {
82
-		return __( 'Comment removed.', 'wordpoints' );
82
+		return __('Comment removed.', 'wordpoints');
83 83
 	}
84 84
 }
85 85
 
Please login to merge, or discard this patch.
src/includes/classes/hook/extension/miss/listeneri.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 	 *
22 22
 	 * @param WordPoints_Hook_Fire $fire The fire that was a miss.
23 23
 	 */
24
-	public function after_miss( WordPoints_Hook_Fire $fire );
24
+	public function after_miss(WordPoints_Hook_Fire $fire);
25 25
 }
26 26
 
27 27
 // EOF
Please login to merge, or discard this patch.
src/includes/classes/hook/extension/reversals/legacy/points.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
 	/**
24 24
 	 * @since 1.0.0
25 25
 	 */
26
-	public function should_hit( WordPoints_Hook_Fire $fire ) {
26
+	public function should_hit(WordPoints_Hook_Fire $fire) {
27 27
 
28
-		if ( ! parent::should_hit( $fire ) ) {
28
+		if ( ! parent::should_hit($fire)) {
29 29
 
30
-			$logs = $this->get_points_logs_to_be_reversed( $fire );
30
+			$logs = $this->get_points_logs_to_be_reversed($fire);
31 31
 
32
-			return count( $logs ) > 0;
32
+			return count($logs) > 0;
33 33
 		}
34 34
 
35 35
 		return true;
@@ -38,16 +38,16 @@  discard block
 block discarded – undo
38 38
 	/**
39 39
 	 * @since 1.0.0
40 40
 	 */
41
-	public function after_miss( WordPoints_Hook_Fire $fire ) {
41
+	public function after_miss(WordPoints_Hook_Fire $fire) {
42 42
 
43
-		parent::after_miss( $fire );
43
+		parent::after_miss($fire);
44 44
 
45
-		if ( ! $this->get_settings_from_fire( $fire ) ) {
45
+		if ( ! $this->get_settings_from_fire($fire)) {
46 46
 			return;
47 47
 		}
48 48
 
49
-		foreach ( $this->get_points_logs_to_be_reversed( $fire ) as $log ) {
50
-			wordpoints_add_points_log_meta( $log->id, 'auto_reversed', 0 );
49
+		foreach ($this->get_points_logs_to_be_reversed($fire) as $log) {
50
+			wordpoints_add_points_log_meta($log->id, 'auto_reversed', 0);
51 51
 		}
52 52
 	}
53 53
 
@@ -60,23 +60,23 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @return array The points logs to be reversed.
62 62
 	 */
63
-	protected function get_points_logs_to_be_reversed( WordPoints_Hook_Fire $fire ) {
63
+	protected function get_points_logs_to_be_reversed(WordPoints_Hook_Fire $fire) {
64 64
 
65
-		if ( isset( $fire->data[ $this->slug ]['points_logs'] ) ) {
66
-			return $fire->data[ $this->slug ]['points_logs'];
65
+		if (isset($fire->data[$this->slug]['points_logs'])) {
66
+			return $fire->data[$this->slug]['points_logs'];
67 67
 		}
68 68
 
69 69
 		$entity = $fire->event_args->get_primary_arg();
70 70
 
71
-		if ( ! $entity ) {
72
-			$fire->data[ $this->slug ]['points_logs'] = array();
71
+		if ( ! $entity) {
72
+			$fire->data[$this->slug]['points_logs'] = array();
73 73
 			return array();
74 74
 		}
75 75
 
76 76
 		$slug = $entity->get_slug();
77 77
 
78
-		if ( ( $pos = strpos( $slug, '\\' ) ) ) {
79
-			$slug = substr( $slug, 0, $pos );
78
+		if (($pos = strpos($slug, '\\'))) {
79
+			$slug = substr($slug, 0, $pos);
80 80
 		}
81 81
 
82 82
 		$meta_queries = array(
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 			)
93 93
 		);
94 94
 
95
-		$log_type = $fire->reaction->get_meta( 'legacy_log_type' );
95
+		$log_type = $fire->reaction->get_meta('legacy_log_type');
96 96
 
97
-		if ( ! $log_type ) {
97
+		if ( ! $log_type) {
98 98
 			$log_type = $fire->reaction->get_event_slug();
99 99
 		}
100 100
 
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
 
108 108
 		$logs = $query->get();
109 109
 
110
-		if ( ! $logs ) {
110
+		if ( ! $logs) {
111 111
 			$logs = array();
112 112
 		}
113 113
 
114
-		$fire->data[ $this->slug ]['points_logs'] = $logs;
114
+		$fire->data[$this->slug]['points_logs'] = $logs;
115 115
 
116 116
 		return $logs;
117 117
 	}
Please login to merge, or discard this patch.