Completed
Push — master ( 84d505...b488c9 )
by J.D.
07:36 queued 14s
created
src/includes/classes/hook/condition/entity/array/contains.php 1 patch
Spacing   +34 added lines, -34 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
 	public function get_title() {
59
-		return __( 'Contains', 'wordpoints' );
59
+		return __('Contains', 'wordpoints');
60 60
 	}
61 61
 
62 62
 	/**
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 		return array(
67 67
 			'min' => array(
68 68
 				'slug'    => 'min',
69
-				'label'   => __( 'Minimum number of items', 'wordpoints' ),
69
+				'label'   => __('Minimum number of items', 'wordpoints'),
70 70
 				'type'    => 'number',
71 71
 				'default' => 1,
72 72
 			),
73 73
 			'max' => array(
74 74
 				'slug'  => 'max',
75
-				'label' => __( 'Maximum number of items', 'wordpoints' ),
75
+				'label' => __('Maximum number of items', 'wordpoints'),
76 76
 				'type'  => 'number',
77 77
 			),
78 78
 		);
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 
93 93
 		$this->validate_count();
94 94
 
95
-		if ( isset( $settings['conditions'] ) ) {
96
-			$this->validate_conditions( $arg );
95
+		if (isset($settings['conditions'])) {
96
+			$this->validate_conditions($arg);
97 97
 		}
98 98
 
99 99
 		return $this->settings;
@@ -107,31 +107,31 @@  discard block
 block discarded – undo
107 107
 	protected function validate_count() {
108 108
 
109 109
 		if (
110
-			! empty( $this->settings['max'] )
111
-			&& ! wordpoints_posint( $this->settings['max'] )
110
+			! empty($this->settings['max'])
111
+			&& ! wordpoints_posint($this->settings['max'])
112 112
 		) {
113 113
 			$this->validator->add_error(
114
-				__( 'The maximum must be a positive integer.', 'wordpoints' )
114
+				__('The maximum must be a positive integer.', 'wordpoints')
115 115
 				, 'max'
116 116
 			);
117 117
 		}
118 118
 
119
-		if ( ! empty( $this->settings['min'] ) ) {
119
+		if ( ! empty($this->settings['min'])) {
120 120
 
121
-			if ( ! wordpoints_posint( $this->settings['min'] ) ) {
121
+			if ( ! wordpoints_posint($this->settings['min'])) {
122 122
 
123 123
 				$this->validator->add_error(
124
-					__( 'The minimum must be a positive integer.', 'wordpoints' )
124
+					__('The minimum must be a positive integer.', 'wordpoints')
125 125
 					, 'min'
126 126
 				);
127 127
 
128 128
 			} elseif (
129
-				! empty( $this->settings['max'] )
129
+				! empty($this->settings['max'])
130 130
 				&& $this->settings['max'] < $this->settings['min']
131 131
 			) {
132 132
 
133 133
 				$this->validator->add_error(
134
-					__( 'The minimum must be less than the maximum.', 'wordpoints' )
134
+					__('The minimum must be less than the maximum.', 'wordpoints')
135 135
 					, 'min'
136 136
 				);
137 137
 			}
@@ -145,25 +145,25 @@  discard block
 block discarded – undo
145 145
 	 *
146 146
 	 * @param WordPoints_EntityishI $current_arg The current arg.
147 147
 	 */
148
-	protected function validate_conditions( $current_arg ) {
148
+	protected function validate_conditions($current_arg) {
149 149
 
150
-		$args = new WordPoints_Hook_Event_Args( array() );
150
+		$args = new WordPoints_Hook_Event_Args(array());
151 151
 
152
-		if ( $current_arg instanceof WordPoints_Entity_Array ) {
152
+		if ($current_arg instanceof WordPoints_Entity_Array) {
153 153
 
154 154
 			$entity = wordpoints_entities()->get(
155 155
 				$current_arg->get_entity_slug()
156 156
 			);
157 157
 
158
-			if ( $entity instanceof WordPoints_Entity ) {
159
-				$args->add_entity( $entity );
158
+			if ($entity instanceof WordPoints_Entity) {
159
+				$args->add_entity($entity);
160 160
 			}
161 161
 		}
162 162
 
163
-		$args->set_validator( $this->validator );
163
+		$args->set_validator($this->validator);
164 164
 
165 165
 		$conditions = $this->conditions_extension->validate_settings(
166
-			array( 'conditions' => $this->settings['conditions'] )
166
+			array('conditions' => $this->settings['conditions'])
167 167
 			, $this->validator
168 168
 			, $args
169 169
 		);
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	/**
175 175
 	 * @since 1.0.0
176 176
 	 */
177
-	public function is_met( array $settings, WordPoints_Hook_Event_Args $args ) {
177
+	public function is_met(array $settings, WordPoints_Hook_Event_Args $args) {
178 178
 
179 179
 		$this->settings = $settings;
180 180
 
@@ -182,16 +182,16 @@  discard block
 block discarded – undo
182 182
 
183 183
 		$entities = array();
184 184
 
185
-		if ( $arg instanceof WordPoints_Entity_Array ) {
185
+		if ($arg instanceof WordPoints_Entity_Array) {
186 186
 
187 187
 			$entities = $arg->get_the_entities();
188 188
 
189
-			if ( isset( $this->settings['conditions'] ) ) {
190
-				$entities = $this->filter_entities( $entities );
189
+			if (isset($this->settings['conditions'])) {
190
+				$entities = $this->filter_entities($entities);
191 191
 			}
192 192
 		}
193 193
 
194
-		return $this->check_count( count( $entities ) );
194
+		return $this->check_count(count($entities));
195 195
 	}
196 196
 
197 197
 	/**
@@ -203,20 +203,20 @@  discard block
 block discarded – undo
203 203
 	 *
204 204
 	 * @return WordPoints_Entity[] The entities that matched the sub-conditions.
205 205
 	 */
206
-	protected function filter_entities( $entities ) {
206
+	protected function filter_entities($entities) {
207 207
 
208
-		foreach ( $entities as $index => $entity ) {
208
+		foreach ($entities as $index => $entity) {
209 209
 
210
-			$event_args = new WordPoints_Hook_Event_Args( array() );
211
-			$event_args->add_entity( $entity );
210
+			$event_args = new WordPoints_Hook_Event_Args(array());
211
+			$event_args->add_entity($entity);
212 212
 
213 213
 			$matches = $this->conditions_extension->conditions_are_met(
214 214
 				$this->settings['conditions']
215 215
 				, $event_args
216 216
 			);
217 217
 
218
-			if ( ! $matches ) {
219
-				unset( $entities[ $index ] );
218
+			if ( ! $matches) {
219
+				unset($entities[$index]);
220 220
 			}
221 221
 		}
222 222
 
@@ -232,13 +232,13 @@  discard block
 block discarded – undo
232 232
 	 *
233 233
 	 * @return bool Whether the count met the requirements.
234 234
 	 */
235
-	protected function check_count( $count ) {
235
+	protected function check_count($count) {
236 236
 
237
-		if ( isset( $this->settings['max'] ) && $count > $this->settings['max'] ) {
237
+		if (isset($this->settings['max']) && $count > $this->settings['max']) {
238 238
 			return false;
239 239
 		}
240 240
 
241
-		if ( isset( $this->settings['min'] ) && $count < $this->settings['min'] ) {
241
+		if (isset($this->settings['min']) && $count < $this->settings['min']) {
242 242
 			return false;
243 243
 		}
244 244
 
Please login to merge, or discard this patch.
src/includes/classes/hook/extension/conditions.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -42,14 +42,14 @@  discard block
 block discarded – undo
42 42
 
43 43
 		$conditions_data = array();
44 44
 
45
-		foreach ( $this->conditions->get_all() as $data_type => $conditions ) {
46
-			foreach ( $conditions as $slug => $condition ) {
45
+		foreach ($this->conditions->get_all() as $data_type => $conditions) {
46
+			foreach ($conditions as $slug => $condition) {
47 47
 
48
-				if ( ! ( $condition instanceof WordPoints_Hook_Condition ) ) {
48
+				if ( ! ($condition instanceof WordPoints_Hook_Condition)) {
49 49
 					continue;
50 50
 				}
51 51
 
52
-				$conditions_data[ $data_type ][ $slug ] = array(
52
+				$conditions_data[$data_type][$slug] = array(
53 53
 					'slug'      => $slug,
54 54
 					'data_type' => $data_type,
55 55
 					'title'     => $condition->get_title(),
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 			}
59 59
 		}
60 60
 
61
-		return array( 'conditions' => $conditions_data );
61
+		return array('conditions' => $conditions_data);
62 62
 	}
63 63
 
64 64
 	/**
@@ -70,31 +70,31 @@  discard block
 block discarded – undo
70 70
 	 *
71 71
 	 * @return array The validated settings.
72 72
 	 */
73
-	protected function validate_conditions( $args ) {
73
+	protected function validate_conditions($args) {
74 74
 
75
-		if ( ! is_array( $args ) ) {
75
+		if ( ! is_array($args)) {
76 76
 
77 77
 			$this->validator->add_error(
78
-				__( 'Conditions do not match expected format.', 'wordpoints' )
78
+				__('Conditions do not match expected format.', 'wordpoints')
79 79
 			);
80 80
 
81 81
 			return array();
82 82
 		}
83 83
 
84
-		foreach ( $args as $arg_slug => $sub_args ) {
84
+		foreach ($args as $arg_slug => $sub_args) {
85 85
 
86
-			if ( '_conditions' === $arg_slug ) {
86
+			if ('_conditions' === $arg_slug) {
87 87
 
88
-				$this->validator->push_field( $arg_slug );
88
+				$this->validator->push_field($arg_slug);
89 89
 
90
-				foreach ( $sub_args as $index => $settings ) {
90
+				foreach ($sub_args as $index => $settings) {
91 91
 
92
-					$this->validator->push_field( $index );
92
+					$this->validator->push_field($index);
93 93
 
94
-					$condition = $this->validate_condition( $settings );
94
+					$condition = $this->validate_condition($settings);
95 95
 
96
-					if ( $condition ) {
97
-						$sub_args[ $index ] = $condition;
96
+					if ($condition) {
97
+						$sub_args[$index] = $condition;
98 98
 					}
99 99
 
100 100
 					$this->validator->pop_field();
@@ -104,18 +104,18 @@  discard block
 block discarded – undo
104 104
 
105 105
 			} else {
106 106
 
107
-				if ( ! $this->event_args->descend( $arg_slug ) ) {
107
+				if ( ! $this->event_args->descend($arg_slug)) {
108 108
 					continue;
109 109
 				}
110 110
 
111
-				$sub_args = $this->validate_conditions( $sub_args );
111
+				$sub_args = $this->validate_conditions($sub_args);
112 112
 
113
-				$args[ $arg_slug ] = $sub_args;
113
+				$args[$arg_slug] = $sub_args;
114 114
 
115 115
 				$this->event_args->ascend();
116 116
 			}
117 117
 
118
-			$args[ $arg_slug ] = $sub_args;
118
+			$args[$arg_slug] = $sub_args;
119 119
 		}
120 120
 
121 121
 		return $args;
@@ -131,32 +131,32 @@  discard block
 block discarded – undo
131 131
 	 * @return array|false The validated conditions settings, or false if unable to
132 132
 	 *                     validate.
133 133
 	 */
134
-	protected function validate_condition( $settings ) {
134
+	protected function validate_condition($settings) {
135 135
 
136
-		if ( ! isset( $settings['type'] ) ) {
137
-			$this->validator->add_error( __( 'Condition type is missing.', 'wordpoints' ) );
136
+		if ( ! isset($settings['type'])) {
137
+			$this->validator->add_error(__('Condition type is missing.', 'wordpoints'));
138 138
 			return false;
139 139
 		}
140 140
 
141 141
 		$arg = $this->event_args->get_current();
142 142
 
143
-		$data_type = $this->get_data_type( $arg );
143
+		$data_type = $this->get_data_type($arg);
144 144
 
145
-		if ( ! $data_type ) {
145
+		if ( ! $data_type) {
146 146
 			$this->validator->add_error(
147
-				__( 'This type of condition does not work for the selected attribute.', 'wordpoints' )
147
+				__('This type of condition does not work for the selected attribute.', 'wordpoints')
148 148
 			);
149 149
 
150 150
 			return false;
151 151
 		}
152 152
 
153
-		$condition = wordpoints_hooks()->conditions->get( $data_type, $settings['type'] );
153
+		$condition = wordpoints_hooks()->conditions->get($data_type, $settings['type']);
154 154
 
155
-		if ( ! $condition ) {
155
+		if ( ! $condition) {
156 156
 
157 157
 			$this->validator->add_error(
158 158
 				sprintf(
159
-					__( 'Unknown condition type &#8220;%s&#8221;.', 'wordpoints' )
159
+					__('Unknown condition type &#8220;%s&#8221;.', 'wordpoints')
160 160
 					, $settings['type']
161 161
 				)
162 162
 				, 'type'
@@ -165,17 +165,17 @@  discard block
 block discarded – undo
165 165
 			return false;
166 166
 		}
167 167
 
168
-		if ( ! isset( $settings['settings'] ) ) {
169
-			$this->validator->add_error( __( 'Condition settings are missing.', 'wordpoints' ) );
168
+		if ( ! isset($settings['settings'])) {
169
+			$this->validator->add_error(__('Condition settings are missing.', 'wordpoints'));
170 170
 			return false;
171 171
 		}
172 172
 
173
-		$this->validator->push_field( 'settings' );
173
+		$this->validator->push_field('settings');
174 174
 
175 175
 		// The condition may call this object's validate_settings() method to
176 176
 		// validate some sub-conditions. When that happens, these properties will be
177 177
 		// reset, so we need to back up their values and then restore them below.
178
-		$backup = array( $this->validator, $this->event_args );
178
+		$backup = array($this->validator, $this->event_args);
179 179
 
180 180
 		$settings['settings'] = $condition->validate_settings(
181 181
 			$arg
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 			, $this->validator
184 184
 		);
185 185
 
186
-		list( $this->validator, $this->event_args ) = $backup;
186
+		list($this->validator, $this->event_args) = $backup;
187 187
 
188 188
 		$this->validator->pop_field();
189 189
 
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
 		WordPoints_Hook_Event_Args $event_args
199 199
 	) {
200 200
 
201
-		$conditions = $reaction->get_meta( 'conditions' );
201
+		$conditions = $reaction->get_meta('conditions');
202 202
 
203
-		if ( $conditions && ! $this->conditions_are_met( $conditions, $event_args ) ) {
203
+		if ($conditions && ! $this->conditions_are_met($conditions, $event_args)) {
204 204
 			return false;
205 205
 		}
206 206
 
@@ -222,35 +222,35 @@  discard block
 block discarded – undo
222 222
 		WordPoints_Hook_Event_Args $event_args
223 223
 	) {
224 224
 
225
-		foreach ( $conditions as $arg_slug => $sub_args ) {
225
+		foreach ($conditions as $arg_slug => $sub_args) {
226 226
 
227
-			$event_args->descend( $arg_slug );
227
+			$event_args->descend($arg_slug);
228 228
 
229
-			if ( isset( $sub_args['_conditions'] ) ) {
229
+			if (isset($sub_args['_conditions'])) {
230 230
 
231
-				foreach ( $sub_args['_conditions'] as $settings ) {
231
+				foreach ($sub_args['_conditions'] as $settings) {
232 232
 
233 233
 					$condition = $this->conditions->get(
234
-						$this->get_data_type( $event_args->get_current() )
234
+						$this->get_data_type($event_args->get_current())
235 235
 						, $settings['type']
236 236
 					);
237 237
 
238
-					$is_met = $condition->is_met( $settings['settings'], $event_args );
238
+					$is_met = $condition->is_met($settings['settings'], $event_args);
239 239
 
240
-					if ( ! $is_met ) {
240
+					if ( ! $is_met) {
241 241
 						$event_args->ascend();
242 242
 						return false;
243 243
 					}
244 244
 				}
245 245
 
246
-				unset( $sub_args['_conditions'] );
246
+				unset($sub_args['_conditions']);
247 247
 			}
248 248
 
249
-			$are_met = $this->conditions_are_met( $sub_args, $event_args );
249
+			$are_met = $this->conditions_are_met($sub_args, $event_args);
250 250
 
251 251
 			$event_args->ascend();
252 252
 
253
-			if ( ! $are_met ) {
253
+			if ( ! $are_met) {
254 254
 				return false;
255 255
 			}
256 256
 		}
@@ -267,13 +267,13 @@  discard block
 block discarded – undo
267 267
 	 *
268 268
 	 * @return string|false The data type, or false.
269 269
 	 */
270
-	protected function get_data_type( $arg ) {
270
+	protected function get_data_type($arg) {
271 271
 
272
-		if ( $arg instanceof WordPoints_Entity_Attr ) {
272
+		if ($arg instanceof WordPoints_Entity_Attr) {
273 273
 			$data_type = $arg->get_data_type();
274
-		} elseif ( $arg instanceof WordPoints_Entity_Array ) {
274
+		} elseif ($arg instanceof WordPoints_Entity_Array) {
275 275
 			$data_type = 'entity_array';
276
-		} elseif ( $arg instanceof WordPoints_Entity ) {
276
+		} elseif ($arg instanceof WordPoints_Entity) {
277 277
 			$data_type = 'entity';
278 278
 		} else {
279 279
 			$data_type = false;
Please login to merge, or discard this patch.
src/includes/classes/hook/event/media/upload.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	 */
20 20
 	public function get_title() {
21 21
 
22
-		return __( 'Upload Media', 'wordpoints' );
22
+		return __('Upload Media', 'wordpoints');
23 23
 	}
24 24
 
25 25
 	/**
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 */
28 28
 	public function get_description() {
29 29
 
30
-		return __( 'When a file is uploaded to the Media Library.', 'wordpoints' );
30
+		return __('When a file is uploaded to the Media Library.', 'wordpoints');
31 31
 	}
32 32
 }
33 33
 
Please login to merge, or discard this patch.
src/includes/classes/entity/post.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function get_title() {
38 38
 
39
-		$post_type = get_post_type_object( substr( $this->slug, 5 /* post\ */ ) );
39
+		$post_type = get_post_type_object(substr($this->slug, 5 /* post\ */));
40 40
 
41
-		if ( $post_type ) {
41
+		if ($post_type) {
42 42
 			return $post_type->labels->singular_name;
43 43
 		} else {
44 44
 			return $this->slug;
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 	/**
49 49
 	 * @since 1.0.0
50 50
 	 */
51
-	public function user_can_view( $user_id, $id ) {
52
-		return user_can( $user_id, 'read_post', $id );
51
+	public function user_can_view($user_id, $id) {
52
+		return user_can($user_id, 'read_post', $id);
53 53
 	}
54 54
 }
55 55
 
Please login to merge, or discard this patch.
src/includes/classes/entity/term.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function get_title() {
31 31
 
32
-		$taxonomy = get_taxonomy( substr( $this->slug, 5 /* term\ */ ) );
32
+		$taxonomy = get_taxonomy(substr($this->slug, 5 /* term\ */));
33 33
 
34
-		if ( $taxonomy ) {
34
+		if ($taxonomy) {
35 35
 			return $taxonomy->labels->singular_name;
36 36
 		} else {
37 37
 			return $this->slug;
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 	/**
42 42
 	 * @since 1.0.0
43 43
 	 */
44
-	public function get_entity( $id ) {
45
-		return get_term( $id, 'taxonomy' );
44
+	public function get_entity($id) {
45
+		return get_term($id, 'taxonomy');
46 46
 	}
47 47
 }
48 48
 
Please login to merge, or discard this patch.
src/includes/classes/entity/post/terms.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function get_title() {
31 31
 
32
-		$taxonomy = get_taxonomy( substr( $this->slug, 6 /* terms\ */ ) );
32
+		$taxonomy = get_taxonomy(substr($this->slug, 6 /* terms\ */));
33 33
 
34
-		if ( $taxonomy ) {
34
+		if ($taxonomy) {
35 35
 			return $taxonomy->labels->name;
36 36
 		} else {
37 37
 			return parent::get_title();
@@ -41,13 +41,13 @@  discard block
 block discarded – undo
41 41
 	/**
42 42
 	 * @since 1.0.0
43 43
 	 */
44
-	protected function get_related_entity_ids( WordPoints_Entity $entity ) {
44
+	protected function get_related_entity_ids(WordPoints_Entity $entity) {
45 45
 
46 46
 		$id = $entity->get_the_id();
47 47
 
48
-		$taxonomies = get_object_taxonomies( get_post( $id ) );
48
+		$taxonomies = get_object_taxonomies(get_post($id));
49 49
 
50
-		return wp_get_object_terms( $id, $taxonomies, array( 'fields' => 'ids' ) );
50
+		return wp_get_object_terms($id, $taxonomies, array('fields' => 'ids'));
51 51
 	}
52 52
 }
53 53
 
Please login to merge, or discard this patch.
src/includes/classes/app.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -97,16 +97,16 @@  discard block
 block discarded – undo
97 97
 	/**
98 98
 	 * @since 1.0.0
99 99
 	 */
100
-	public function __construct( $slug, $parent = null ) {
100
+	public function __construct($slug, $parent = null) {
101 101
 
102 102
 		$this->slug = $slug;
103 103
 		$this->full_slug = $slug;
104 104
 
105
-		if ( $parent instanceof WordPoints_App ) {
105
+		if ($parent instanceof WordPoints_App) {
106 106
 			$this->parent = $parent;
107 107
 
108
-			if ( 'apps' !== $this->parent->full_slug ) {
109
-				$this->full_slug = $this->parent->full_slug . '-' . $this->full_slug;
108
+			if ('apps' !== $this->parent->full_slug) {
109
+				$this->full_slug = $this->parent->full_slug.'-'.$this->full_slug;
110 110
 			}
111 111
 		}
112 112
 
@@ -118,32 +118,32 @@  discard block
 block discarded – undo
118 118
 	/**
119 119
 	 * @since 1.0.0
120 120
 	 */
121
-	public function __isset( $var ) {
122
-		return $this->sub_apps->is_registered( $var );
121
+	public function __isset($var) {
122
+		return $this->sub_apps->is_registered($var);
123 123
 	}
124 124
 
125 125
 	/**
126 126
 	 * @since 1.0.0
127 127
 	 */
128
-	public function __get( $var ) {
128
+	public function __get($var) {
129 129
 
130
-		if ( 'sub_apps' === $var ) {
130
+		if ('sub_apps' === $var) {
131 131
 			return $this->$var;
132 132
 		}
133 133
 
134
-		$sub = $this->sub_apps->get( $var, array( $this ) );
134
+		$sub = $this->sub_apps->get($var, array($this));
135 135
 
136
-		if ( ! $sub ) {
136
+		if ( ! $sub) {
137 137
 			return null;
138 138
 		}
139 139
 
140 140
 		if (
141
-			empty( $this->did_init[ $var ] )
141
+			empty($this->did_init[$var])
142 142
 			&& ! self::$main->silent
143
-			&& $this->should_do_registry_init( $sub )
143
+			&& $this->should_do_registry_init($sub)
144 144
 		) {
145 145
 
146
-			$is_protected_property = array_key_exists( $var, get_object_vars( $this ) );
146
+			$is_protected_property = array_key_exists($var, get_object_vars($this));
147 147
 
148 148
 			// When the below action is called it is possible that some hooked code
149 149
 			// may attempt to access the property that is being initialized. However,
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 			// temporarily set this as a public property. However, we can't do this
153 153
 			// for properties that the class has declared, because otherwise it would
154 154
 			// be possible to modify and then unset protected class properties.
155
-			if ( ! $is_protected_property ) {
155
+			if ( ! $is_protected_property) {
156 156
 				$this->allow_set = true;
157 157
 				$this->$var = $sub;
158 158
 				$this->allow_set = false;
@@ -168,25 +168,25 @@  discard block
 block discarded – undo
168 168
 			 * @param WordPoints_Class_RegistryI|WordPoints_Class_Registry_ChildrenI
169 169
 			 *        $registry The registry object.
170 170
 			 */
171
-			do_action( "wordpoints_init_app_registry-{$this->full_slug}-{$var}", $sub );
171
+			do_action("wordpoints_init_app_registry-{$this->full_slug}-{$var}", $sub);
172 172
 
173 173
 			// Because this property was public, it's possible that it might have
174 174
 			// been modified inadvertently. If this happens we give a warning.
175
-			if ( $sub !== $this->$var ) {
175
+			if ($sub !== $this->$var) {
176 176
 				_doing_it_wrong(
177 177
 					__METHOD__
178
-					, esc_html( "Do not modify the {$var} property directly." )
178
+					, esc_html("Do not modify the {$var} property directly.")
179 179
 					, '1.0.0'
180 180
 				);
181 181
 			}
182 182
 
183
-			if ( ! $is_protected_property ) {
183
+			if ( ! $is_protected_property) {
184 184
 				$this->allow_set = true;
185
-				unset( $this->$var );
185
+				unset($this->$var);
186 186
 				$this->allow_set = false;
187 187
 			}
188 188
 
189
-			$this->did_init[ $var ] = true;
189
+			$this->did_init[$var] = true;
190 190
 		}
191 191
 
192 192
 		return $sub;
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 	/**
196 196
 	 * @since 1.0.0
197 197
 	 */
198
-	public function __set( $var, $value ) {
198
+	public function __set($var, $value) {
199 199
 
200
-		if ( $this->allow_set ) {
200
+		if ($this->allow_set) {
201 201
 			$this->$var = $value;
202 202
 		} else {
203 203
 			_doing_it_wrong(
@@ -211,10 +211,10 @@  discard block
 block discarded – undo
211 211
 	/**
212 212
 	 * @since 1.0.0
213 213
 	 */
214
-	public function __unset( $var ) {
214
+	public function __unset($var) {
215 215
 
216
-		if ( $this->allow_set ) {
217
-			unset( $this->$var );
216
+		if ($this->allow_set) {
217
+			unset($this->$var);
218 218
 		} else {
219 219
 			_doing_it_wrong(
220 220
 				__METHOD__
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	 *
234 234
 	 * @return bool Whether to call the init action or not.
235 235
 	 */
236
-	protected function should_do_registry_init( $registry ) {
236
+	protected function should_do_registry_init($registry) {
237 237
 		return (
238 238
 		   $registry instanceof WordPoints_Class_RegistryI
239 239
 		   || $registry instanceof WordPoints_Class_Registry_ChildrenI
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 		 *
258 258
 		 * @param WordPoints_App $app The app object.
259 259
 		 */
260
-		do_action( "wordpoints_init_app-{$this->full_slug}", $this );
260
+		do_action("wordpoints_init_app-{$this->full_slug}", $this);
261 261
 	}
262 262
 }
263 263
 
Please login to merge, or discard this patch.
src/includes/classes/hook/arg/dynamic.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
 	/**
38 38
 	 * @since 1.0.0
39 39
 	 */
40
-	public function __construct( $slug, WordPoints_Hook_ActionI $action = null ) {
40
+	public function __construct($slug, WordPoints_Hook_ActionI $action = null) {
41 41
 
42
-		parent::__construct( $slug, $action );
42
+		parent::__construct($slug, $action);
43 43
 
44
-		$parts = wordpoints_parse_dynamic_slug( $this->slug );
44
+		$parts = wordpoints_parse_dynamic_slug($this->slug);
45 45
 
46
-		if ( $parts['dynamic'] ) {
46
+		if ($parts['dynamic']) {
47 47
 			$this->arg_slug = $parts['generic'];
48 48
 		} else {
49 49
 			$this->arg_slug = $this->slug;
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 		$value = parent::get_value();
60 60
 
61 61
 		// If not, then we check for an arg with the generic name.
62
-		if ( null === $value && $this->action instanceof WordPoints_Hook_ActionI ) {
63
-			$value = $this->action->get_arg_value( $this->arg_slug );
62
+		if (null === $value && $this->action instanceof WordPoints_Hook_ActionI) {
63
+			$value = $this->action->get_arg_value($this->arg_slug);
64 64
 		}
65 65
 
66 66
 		return $value;
Please login to merge, or discard this patch.
src/includes/classes/hook/event/dynamic.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,17 +46,17 @@
 block discarded – undo
46 46
 	 */
47 47
 	protected function get_entity_title() {
48 48
 
49
-		$parts = wordpoints_parse_dynamic_slug( $this->slug );
49
+		$parts = wordpoints_parse_dynamic_slug($this->slug);
50 50
 
51
-		if ( $parts['dynamic'] ) {
51
+		if ($parts['dynamic']) {
52 52
 			$entity_slug = "{$this->generic_entity_slug}\\{$parts['dynamic']}";
53 53
 		} else {
54 54
 			$entity_slug = $this->generic_entity_slug;
55 55
 		}
56 56
 
57
-		$entity = wordpoints_entities()->get( $entity_slug );
57
+		$entity = wordpoints_entities()->get($entity_slug);
58 58
 
59
-		if ( ! $entity instanceof WordPoints_Entity ) {
59
+		if ( ! $entity instanceof WordPoints_Entity) {
60 60
 			return $this->slug;
61 61
 		}
62 62
 
Please login to merge, or discard this patch.