Completed
Push — master ( 071e73...82b9ae )
by J.D.
02:50
created
src/includes/classes/hook/reactor.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -97,30 +97,30 @@  discard block
 block discarded – undo
97 97
 	/**
98 98
 	 * @since 1.0.0
99 99
 	 */
100
-	public function __get( $var ) {
100
+	public function __get($var) {
101 101
 
102 102
 		$network_mode = wordpoints_hooks()->get_network_mode();
103 103
 
104
-		switch ( $var ) {
104
+		switch ($var) {
105 105
 			case 'reactions':
106 106
 				$var = $network_mode ? 'network_reactions' : 'standard_reactions';
107 107
 				// fall through
108 108
 
109 109
 			case 'standard_reactions':
110 110
 			case 'network_reactions':
111
-				if ( $network_mode && 'standard_reactions' === $var ) {
111
+				if ($network_mode && 'standard_reactions' === $var) {
112 112
 					return null;
113 113
 				}
114 114
 
115
-				if ( 'network_reactions' === $var && ! $this->is_network_wide() ) {
115
+				if ('network_reactions' === $var && ! $this->is_network_wide()) {
116 116
 					return null;
117 117
 				}
118 118
 
119
-				if ( ! isset( $this->$var ) ) {
120
-					if ( isset( $this->{"{$var}_class"} ) ) {
119
+				if ( ! isset($this->$var)) {
120
+					if (isset($this->{"{$var}_class"} )) {
121 121
 						$this->$var = new $this->{"{$var}_class"}(
122 122
 							$this->slug
123
-							, ( 'network_reactions' === $var )
123
+							, ('network_reactions' === $var)
124 124
 						);
125 125
 					}
126 126
 				}
@@ -194,21 +194,21 @@  discard block
 block discarded – undo
194 194
 	 *
195 195
 	 * @return WordPoints_Hook_ReactionI[] All of the reaction objects.
196 196
 	 */
197
-	public function get_all_reactions_to_event( $event_slug ) {
197
+	public function get_all_reactions_to_event($event_slug) {
198 198
 
199 199
 		$reactions = array();
200 200
 
201
-		foreach ( array( 'standard', 'network' ) as $store ) {
201
+		foreach (array('standard', 'network') as $store) {
202 202
 
203 203
 			$storage = $this->{"{$store}_reactions"};
204 204
 
205
-			if ( ! $storage instanceof WordPoints_Hook_Reaction_StorageI ) {
205
+			if ( ! $storage instanceof WordPoints_Hook_Reaction_StorageI) {
206 206
 				continue;
207 207
 			}
208 208
 
209 209
 			$reactions = array_merge(
210 210
 				$reactions
211
-				, $storage->get_reactions_to_event( $event_slug )
211
+				, $storage->get_reactions_to_event($event_slug)
212 212
 			);
213 213
 		}
214 214
 
@@ -230,15 +230,15 @@  discard block
 block discarded – undo
230 230
 
231 231
 		$reactions = array();
232 232
 
233
-		foreach ( array( 'standard', 'network' ) as $store ) {
233
+		foreach (array('standard', 'network') as $store) {
234 234
 
235 235
 			$storage = $this->{"{$store}_reactions"};
236 236
 
237
-			if ( ! $storage instanceof WordPoints_Hook_Reaction_StorageI ) {
237
+			if ( ! $storage instanceof WordPoints_Hook_Reaction_StorageI) {
238 238
 				continue;
239 239
 			}
240 240
 
241
-			$reactions = array_merge( $reactions, $storage->get_reactions() );
241
+			$reactions = array_merge($reactions, $storage->get_reactions());
242 242
 		}
243 243
 
244 244
 		return $reactions;
@@ -254,21 +254,21 @@  discard block
 block discarded – undo
254 254
 	) {
255 255
 
256 256
 		if (
257
-			empty( $settings['target'] )
258
-			|| ! is_array( $settings['target'] )
257
+			empty($settings['target'])
258
+			|| ! is_array($settings['target'])
259 259
 		) {
260 260
 
261
-			$validator->add_error( __( 'Invalid target.', 'wordpoints' ), 'target' );
261
+			$validator->add_error(__('Invalid target.', 'wordpoints'), 'target');
262 262
 
263 263
 		} else {
264 264
 
265
-			$target = $event_args->get_from_hierarchy( $settings['target'] );
265
+			$target = $event_args->get_from_hierarchy($settings['target']);
266 266
 
267 267
 			if (
268 268
 				! $target instanceof WordPoints_Entity
269
-				|| ! in_array( $target->get_slug(), (array) $this->arg_types )
269
+				|| ! in_array($target->get_slug(), (array) $this->arg_types)
270 270
 			) {
271
-				$validator->add_error( __( 'Invalid target.', 'wordpoints' ), 'target' );
271
+				$validator->add_error(__('Invalid target.', 'wordpoints'), 'target');
272 272
 			}
273 273
 		}
274 274
 
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
 	/**
279 279
 	 * @since 1.0.0
280 280
 	 */
281
-	public function update_settings( WordPoints_Hook_ReactionI $reaction, array $settings ) {
282
-		$reaction->update_meta( 'target', $settings['target'] );
281
+	public function update_settings(WordPoints_Hook_ReactionI $reaction, array $settings) {
282
+		$reaction->update_meta('target', $settings['target']);
283 283
 	}
284 284
 
285 285
 	/**
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	 * @param WordPoints_Hook_Event_Args         $event_args The event args.
291 291
 	 * @param WordPoints_Hook_Reaction_Validator $reaction   The reaction.
292 292
 	 */
293
-	abstract public function hit( WordPoints_Hook_Event_Args $event_args, WordPoints_Hook_Reaction_Validator $reaction );
293
+	abstract public function hit(WordPoints_Hook_Event_Args $event_args, WordPoints_Hook_Reaction_Validator $reaction);
294 294
 }
295 295
 
296 296
 // EOF
Please login to merge, or discard this patch.
src/includes/classes/hooks.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,13 +46,13 @@  discard block
 block discarded – undo
46 46
 	protected function init() {
47 47
 
48 48
 		$sub_apps = $this->sub_apps;
49
-		$sub_apps->register( 'router', 'WordPoints_Hook_Router' );
50
-		$sub_apps->register( 'actions', 'WordPoints_Hook_Actions' );
51
-		$sub_apps->register( 'events', 'WordPoints_Hook_Events' );
52
-		$sub_apps->register( 'firers', 'WordPoints_Class_Registry_Persistent' );
53
-		$sub_apps->register( 'reactors', 'WordPoints_Class_Registry_Persistent' );
54
-		$sub_apps->register( 'extensions', 'WordPoints_Class_Registry_Persistent' );
55
-		$sub_apps->register( 'conditions', 'WordPoints_Class_Registry_Children' );
49
+		$sub_apps->register('router', 'WordPoints_Hook_Router');
50
+		$sub_apps->register('actions', 'WordPoints_Hook_Actions');
51
+		$sub_apps->register('events', 'WordPoints_Hook_Events');
52
+		$sub_apps->register('firers', 'WordPoints_Class_Registry_Persistent');
53
+		$sub_apps->register('reactors', 'WordPoints_Class_Registry_Persistent');
54
+		$sub_apps->register('extensions', 'WordPoints_Class_Registry_Persistent');
55
+		$sub_apps->register('conditions', 'WordPoints_Class_Registry_Children');
56 56
 
57 57
 		parent::init();
58 58
 	}
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public function get_network_mode() {
68 68
 
69
-		if ( ! isset( $this->network_mode ) ) {
69
+		if ( ! isset($this->network_mode)) {
70 70
 			$this->network_mode = is_network_admin();
71 71
 		}
72 72
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 *
108 108
 	 * @param bool $on Whether network-wide mode should be on (or off).
109 109
 	 */
110
-	public function _set_network_mode( $on = true ) {
110
+	public function _set_network_mode($on = true) {
111 111
 		$this->network_mode = (bool) $on;
112 112
 	}
113 113
 }
Please login to merge, or discard this patch.