Completed
Push — master ( b792a1...ed9362 )
by J.D.
03:30
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/index.php 1 patch
Spacing   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -10,108 +10,108 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 // auto-generated {
13
-require_once( dirname( __FILE__ ) . 'app.php' );
14
-require_once( dirname( __FILE__ ) . 'app/registry.php' );
15
-require_once( dirname( __FILE__ ) . 'class/autoloader.php' );
16
-require_once( dirname( __FILE__ ) . 'class/registry.php' );
17
-require_once( dirname( __FILE__ ) . 'class/registry/children.php' );
18
-require_once( dirname( __FILE__ ) . 'class/registry/childreni.php' );
19
-require_once( dirname( __FILE__ ) . 'class/registry/persistent.php' );
20
-require_once( dirname( __FILE__ ) . 'class/registryi.php' );
21
-require_once( dirname( __FILE__ ) . 'data/type.php' );
22
-require_once( dirname( __FILE__ ) . 'data/type/integer.php' );
23
-require_once( dirname( __FILE__ ) . 'data/type/text.php' );
24
-require_once( dirname( __FILE__ ) . 'data/typei.php' );
25
-require_once( dirname( __FILE__ ) . 'entity.php' );
26
-require_once( dirname( __FILE__ ) . 'entity/array.php' );
27
-require_once( dirname( __FILE__ ) . 'entity/attr.php' );
28
-require_once( dirname( __FILE__ ) . 'entity/childi.php' );
29
-require_once( dirname( __FILE__ ) . 'entity/comment.php' );
30
-require_once( dirname( __FILE__ ) . 'entity/comment/author.php' );
31
-require_once( dirname( __FILE__ ) . 'entity/comment/post.php' );
32
-require_once( dirname( __FILE__ ) . 'entity/enumerablei.php' );
33
-require_once( dirname( __FILE__ ) . 'entity/hierarchy.php' );
34
-require_once( dirname( __FILE__ ) . 'entity/hierarchyi.php' );
35
-require_once( dirname( __FILE__ ) . 'entity/parenti.php' );
36
-require_once( dirname( __FILE__ ) . 'entity/post.php' );
37
-require_once( dirname( __FILE__ ) . 'entity/post/author.php' );
38
-require_once( dirname( __FILE__ ) . 'entity/post/content.php' );
39
-require_once( dirname( __FILE__ ) . 'entity/post/terms.php' );
40
-require_once( dirname( __FILE__ ) . 'entity/post/type.php' );
41
-require_once( dirname( __FILE__ ) . 'entity/post/type/name.php' );
42
-require_once( dirname( __FILE__ ) . 'entity/post/type/relationship.php' );
43
-require_once( dirname( __FILE__ ) . 'entity/relationship.php' );
44
-require_once( dirname( __FILE__ ) . 'entity/relationship/dynamic.php' );
45
-require_once( dirname( __FILE__ ) . 'entity/restricted/visibilityi.php' );
46
-require_once( dirname( __FILE__ ) . 'entity/site.php' );
47
-require_once( dirname( __FILE__ ) . 'entity/term.php' );
48
-require_once( dirname( __FILE__ ) . 'entity/term/id.php' );
49
-require_once( dirname( __FILE__ ) . 'entity/user.php' );
50
-require_once( dirname( __FILE__ ) . 'entity/user/role.php' );
51
-require_once( dirname( __FILE__ ) . 'entity/user/role/name.php' );
52
-require_once( dirname( __FILE__ ) . 'entity/user/roles.php' );
53
-require_once( dirname( __FILE__ ) . 'entityish.php' );
54
-require_once( dirname( __FILE__ ) . 'entityishi.php' );
55
-require_once( dirname( __FILE__ ) . 'hierarchy.php' );
56
-require_once( dirname( __FILE__ ) . 'hook/action.php' );
57
-require_once( dirname( __FILE__ ) . 'hook/action/comment/new.php' );
58
-require_once( dirname( __FILE__ ) . 'hook/action/post/publish.php' );
59
-require_once( dirname( __FILE__ ) . 'hook/actioni.php' );
60
-require_once( dirname( __FILE__ ) . 'hook/actions.php' );
61
-require_once( dirname( __FILE__ ) . 'hook/arg.php' );
62
-require_once( dirname( __FILE__ ) . 'hook/arg/current/post.php' );
63
-require_once( dirname( __FILE__ ) . 'hook/arg/current/site.php' );
64
-require_once( dirname( __FILE__ ) . 'hook/arg/current/user.php' );
65
-require_once( dirname( __FILE__ ) . 'hook/arg/dynamic.php' );
66
-require_once( dirname( __FILE__ ) . 'hook/condition.php' );
67
-require_once( dirname( __FILE__ ) . 'hook/condition/entity/array/contains.php' );
68
-require_once( dirname( __FILE__ ) . 'hook/condition/equals.php' );
69
-require_once( dirname( __FILE__ ) . 'hook/condition/string/contains.php' );
70
-require_once( dirname( __FILE__ ) . 'hook/conditioni.php' );
71
-require_once( dirname( __FILE__ ) . 'hook/event.php' );
72
-require_once( dirname( __FILE__ ) . 'hook/event/args.php' );
73
-require_once( dirname( __FILE__ ) . 'hook/event/comment/leave.php' );
74
-require_once( dirname( __FILE__ ) . 'hook/event/dynamic.php' );
75
-require_once( dirname( __FILE__ ) . 'hook/event/media/upload.php' );
76
-require_once( dirname( __FILE__ ) . 'hook/event/post/publish.php' );
77
-require_once( dirname( __FILE__ ) . 'hook/event/user/register.php' );
78
-require_once( dirname( __FILE__ ) . 'hook/event/user/visit.php' );
79
-require_once( dirname( __FILE__ ) . 'hook/eventi.php' );
80
-require_once( dirname( __FILE__ ) . 'hook/events.php' );
81
-require_once( dirname( __FILE__ ) . 'hook/extension.php' );
82
-require_once( dirname( __FILE__ ) . 'hook/extension/conditions.php' );
83
-require_once( dirname( __FILE__ ) . 'hook/extension/periods.php' );
84
-require_once( dirname( __FILE__ ) . 'hook/extension/reversei.php' );
85
-require_once( dirname( __FILE__ ) . 'hook/extension/spami.php' );
86
-require_once( dirname( __FILE__ ) . 'hook/firer.php' );
87
-require_once( dirname( __FILE__ ) . 'hook/firer/reverse.php' );
88
-require_once( dirname( __FILE__ ) . 'hook/firer/spam.php' );
89
-require_once( dirname( __FILE__ ) . 'hook/fireri.php' );
90
-require_once( dirname( __FILE__ ) . 'hook/reaction.php' );
91
-require_once( dirname( __FILE__ ) . 'hook/reaction/options.php' );
92
-require_once( dirname( __FILE__ ) . 'hook/reaction/storage.php' );
93
-require_once( dirname( __FILE__ ) . 'hook/reaction/storage/options.php' );
94
-require_once( dirname( __FILE__ ) . 'hook/reaction/storage/options/network.php' );
95
-require_once( dirname( __FILE__ ) . 'hook/reaction/storagei.php' );
96
-require_once( dirname( __FILE__ ) . 'hook/reaction/validator.php' );
97
-require_once( dirname( __FILE__ ) . 'hook/reactioni.php' );
98
-require_once( dirname( __FILE__ ) . 'hook/reactor.php' );
99
-require_once( dirname( __FILE__ ) . 'hook/reactor/points.php' );
100
-require_once( dirname( __FILE__ ) . 'hook/reactor/reversei.php' );
101
-require_once( dirname( __FILE__ ) . 'hook/reactor/spami.php' );
102
-require_once( dirname( __FILE__ ) . 'hook/retroactive/conditions.php' );
103
-require_once( dirname( __FILE__ ) . 'hook/retroactive/query.php' );
104
-require_once( dirname( __FILE__ ) . 'hook/retroactive/query/modifieri.php' );
105
-require_once( dirname( __FILE__ ) . 'hook/retroactive/queryable.php' );
106
-require_once( dirname( __FILE__ ) . 'hook/retroactive/queryi.php' );
107
-require_once( dirname( __FILE__ ) . 'hook/router.php' );
108
-require_once( dirname( __FILE__ ) . 'hook/settings.php' );
109
-require_once( dirname( __FILE__ ) . 'hook/settingsi.php' );
110
-require_once( dirname( __FILE__ ) . 'hook/validator/exception.php' );
111
-require_once( dirname( __FILE__ ) . 'hooks.php' );
112
-require_once( dirname( __FILE__ ) . 'query/builder/db/mysql.php' );
113
-require_once( dirname( __FILE__ ) . 'spec.php' );
114
-require_once( dirname( __FILE__ ) . 'specedi.php' );
13
+require_once(dirname(__FILE__).'app.php');
14
+require_once(dirname(__FILE__).'app/registry.php');
15
+require_once(dirname(__FILE__).'class/autoloader.php');
16
+require_once(dirname(__FILE__).'class/registry.php');
17
+require_once(dirname(__FILE__).'class/registry/children.php');
18
+require_once(dirname(__FILE__).'class/registry/childreni.php');
19
+require_once(dirname(__FILE__).'class/registry/persistent.php');
20
+require_once(dirname(__FILE__).'class/registryi.php');
21
+require_once(dirname(__FILE__).'data/type.php');
22
+require_once(dirname(__FILE__).'data/type/integer.php');
23
+require_once(dirname(__FILE__).'data/type/text.php');
24
+require_once(dirname(__FILE__).'data/typei.php');
25
+require_once(dirname(__FILE__).'entity.php');
26
+require_once(dirname(__FILE__).'entity/array.php');
27
+require_once(dirname(__FILE__).'entity/attr.php');
28
+require_once(dirname(__FILE__).'entity/childi.php');
29
+require_once(dirname(__FILE__).'entity/comment.php');
30
+require_once(dirname(__FILE__).'entity/comment/author.php');
31
+require_once(dirname(__FILE__).'entity/comment/post.php');
32
+require_once(dirname(__FILE__).'entity/enumerablei.php');
33
+require_once(dirname(__FILE__).'entity/hierarchy.php');
34
+require_once(dirname(__FILE__).'entity/hierarchyi.php');
35
+require_once(dirname(__FILE__).'entity/parenti.php');
36
+require_once(dirname(__FILE__).'entity/post.php');
37
+require_once(dirname(__FILE__).'entity/post/author.php');
38
+require_once(dirname(__FILE__).'entity/post/content.php');
39
+require_once(dirname(__FILE__).'entity/post/terms.php');
40
+require_once(dirname(__FILE__).'entity/post/type.php');
41
+require_once(dirname(__FILE__).'entity/post/type/name.php');
42
+require_once(dirname(__FILE__).'entity/post/type/relationship.php');
43
+require_once(dirname(__FILE__).'entity/relationship.php');
44
+require_once(dirname(__FILE__).'entity/relationship/dynamic.php');
45
+require_once(dirname(__FILE__).'entity/restricted/visibilityi.php');
46
+require_once(dirname(__FILE__).'entity/site.php');
47
+require_once(dirname(__FILE__).'entity/term.php');
48
+require_once(dirname(__FILE__).'entity/term/id.php');
49
+require_once(dirname(__FILE__).'entity/user.php');
50
+require_once(dirname(__FILE__).'entity/user/role.php');
51
+require_once(dirname(__FILE__).'entity/user/role/name.php');
52
+require_once(dirname(__FILE__).'entity/user/roles.php');
53
+require_once(dirname(__FILE__).'entityish.php');
54
+require_once(dirname(__FILE__).'entityishi.php');
55
+require_once(dirname(__FILE__).'hierarchy.php');
56
+require_once(dirname(__FILE__).'hook/action.php');
57
+require_once(dirname(__FILE__).'hook/action/comment/new.php');
58
+require_once(dirname(__FILE__).'hook/action/post/publish.php');
59
+require_once(dirname(__FILE__).'hook/actioni.php');
60
+require_once(dirname(__FILE__).'hook/actions.php');
61
+require_once(dirname(__FILE__).'hook/arg.php');
62
+require_once(dirname(__FILE__).'hook/arg/current/post.php');
63
+require_once(dirname(__FILE__).'hook/arg/current/site.php');
64
+require_once(dirname(__FILE__).'hook/arg/current/user.php');
65
+require_once(dirname(__FILE__).'hook/arg/dynamic.php');
66
+require_once(dirname(__FILE__).'hook/condition.php');
67
+require_once(dirname(__FILE__).'hook/condition/entity/array/contains.php');
68
+require_once(dirname(__FILE__).'hook/condition/equals.php');
69
+require_once(dirname(__FILE__).'hook/condition/string/contains.php');
70
+require_once(dirname(__FILE__).'hook/conditioni.php');
71
+require_once(dirname(__FILE__).'hook/event.php');
72
+require_once(dirname(__FILE__).'hook/event/args.php');
73
+require_once(dirname(__FILE__).'hook/event/comment/leave.php');
74
+require_once(dirname(__FILE__).'hook/event/dynamic.php');
75
+require_once(dirname(__FILE__).'hook/event/media/upload.php');
76
+require_once(dirname(__FILE__).'hook/event/post/publish.php');
77
+require_once(dirname(__FILE__).'hook/event/user/register.php');
78
+require_once(dirname(__FILE__).'hook/event/user/visit.php');
79
+require_once(dirname(__FILE__).'hook/eventi.php');
80
+require_once(dirname(__FILE__).'hook/events.php');
81
+require_once(dirname(__FILE__).'hook/extension.php');
82
+require_once(dirname(__FILE__).'hook/extension/conditions.php');
83
+require_once(dirname(__FILE__).'hook/extension/periods.php');
84
+require_once(dirname(__FILE__).'hook/extension/reversei.php');
85
+require_once(dirname(__FILE__).'hook/extension/spami.php');
86
+require_once(dirname(__FILE__).'hook/firer.php');
87
+require_once(dirname(__FILE__).'hook/firer/reverse.php');
88
+require_once(dirname(__FILE__).'hook/firer/spam.php');
89
+require_once(dirname(__FILE__).'hook/fireri.php');
90
+require_once(dirname(__FILE__).'hook/reaction.php');
91
+require_once(dirname(__FILE__).'hook/reaction/options.php');
92
+require_once(dirname(__FILE__).'hook/reaction/storage.php');
93
+require_once(dirname(__FILE__).'hook/reaction/storage/options.php');
94
+require_once(dirname(__FILE__).'hook/reaction/storage/options/network.php');
95
+require_once(dirname(__FILE__).'hook/reaction/storagei.php');
96
+require_once(dirname(__FILE__).'hook/reaction/validator.php');
97
+require_once(dirname(__FILE__).'hook/reactioni.php');
98
+require_once(dirname(__FILE__).'hook/reactor.php');
99
+require_once(dirname(__FILE__).'hook/reactor/points.php');
100
+require_once(dirname(__FILE__).'hook/reactor/reversei.php');
101
+require_once(dirname(__FILE__).'hook/reactor/spami.php');
102
+require_once(dirname(__FILE__).'hook/retroactive/conditions.php');
103
+require_once(dirname(__FILE__).'hook/retroactive/query.php');
104
+require_once(dirname(__FILE__).'hook/retroactive/query/modifieri.php');
105
+require_once(dirname(__FILE__).'hook/retroactive/queryable.php');
106
+require_once(dirname(__FILE__).'hook/retroactive/queryi.php');
107
+require_once(dirname(__FILE__).'hook/router.php');
108
+require_once(dirname(__FILE__).'hook/settings.php');
109
+require_once(dirname(__FILE__).'hook/settingsi.php');
110
+require_once(dirname(__FILE__).'hook/validator/exception.php');
111
+require_once(dirname(__FILE__).'hooks.php');
112
+require_once(dirname(__FILE__).'query/builder/db/mysql.php');
113
+require_once(dirname(__FILE__).'spec.php');
114
+require_once(dirname(__FILE__).'specedi.php');
115 115
 // }
116 116
 
117 117
 // EOF
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/admin/includes/classes/screen/points/types.php 1 patch
Spacing   +105 added lines, -105 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,54 +304,54 @@  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();
334
+			if ($arg instanceof WordPoints_Hook_Arg) {
335
+				$event_data['args'][$slug]['title'] = $arg->get_title();
336 336
 			}
337 337
 		}
338 338
 
339 339
 		?>
340 340
 
341 341
 		<script>
342
-			WordPointsHooksAdminData.events[<?php echo wp_json_encode( $event_slug ); ?>] = <?php echo wp_json_encode( $event_data ); ?>;
343
-			WordPointsHooksAdminData.reactions[<?php echo wp_json_encode( $event_slug ); ?>] = <?php echo wp_json_encode( $data ); ?>;
342
+			WordPointsHooksAdminData.events[<?php echo wp_json_encode($event_slug); ?>] = <?php echo wp_json_encode($event_data); ?>;
343
+			WordPointsHooksAdminData.reactions[<?php echo wp_json_encode($event_slug); ?>] = <?php echo wp_json_encode($data); ?>;
344 344
 		</script>
345 345
 
346 346
 		<div class="wordpoints-hook-reaction-group-container">
347 347
 			<p class="description">
348
-				<?php echo esc_html( $meta_box['args']['event']->get_description() ); ?>
348
+				<?php echo esc_html($meta_box['args']['event']->get_description()); ?>
349 349
 			</p>
350 350
 
351 351
 			<div class="wordpoints-hook-reaction-group"
352
-				data-wordpoints-hooks-hook-event="<?php echo esc_attr( $event_slug ); ?>"
353
-				data-wordpoints-hooks-points-type="<?php echo esc_attr( $this->current_points_type ); ?>"
354
-				data-wordpoints-hooks-create-nonce="<?php echo esc_attr( wp_create_nonce( 'wordpoints_create_hook_reaction|points' ) ); ?>"
352
+				data-wordpoints-hooks-hook-event="<?php echo esc_attr($event_slug); ?>"
353
+				data-wordpoints-hooks-points-type="<?php echo esc_attr($this->current_points_type); ?>"
354
+				data-wordpoints-hooks-create-nonce="<?php echo esc_attr(wp_create_nonce('wordpoints_create_hook_reaction|points')); ?>"
355 355
 				data-wordpoints-hooks-reactor="points">
356 356
 			</div>
357 357
 
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 
366 366
 			<div class="controls">
367 367
 				<button type="button" class="button-primary add-reaction">
368
-					<?php esc_html_e( 'Add New', 'wordpoints' ); ?>
368
+					<?php esc_html_e('Add New', 'wordpoints'); ?>
369 369
 				</button>
370 370
 			</div>
371 371
 		</div>
@@ -385,19 +385,19 @@  discard block
 block discarded – undo
385 385
 		// Show a tab for each points type.
386 386
 		$tabs = array();
387 387
 
388
-		foreach ( $points_types as $slug => $settings ) {
389
-			$tabs[ $slug ] = $settings['name'];
388
+		foreach ($points_types as $slug => $settings) {
389
+			$tabs[$slug] = $settings['name'];
390 390
 		}
391 391
 
392
-		$tabs['add-new'] = __( 'Add New', 'wordpoints' );
392
+		$tabs['add-new'] = __('Add New', 'wordpoints');
393 393
 
394
-		$tab = wordpoints_admin_get_current_tab( $tabs );
394
+		$tab = wordpoints_admin_get_current_tab($tabs);
395 395
 
396
-		if ( 'add-new' !== $tab ) {
396
+		if ('add-new' !== $tab) {
397 397
 			$this->current_points_type = $tab;
398 398
 		}
399 399
 
400
-		do_action( 'add_meta_boxes', $this->id );
400
+		do_action('add_meta_boxes', $this->id);
401 401
 
402 402
 		$this->tabs = $tabs;
403 403
 	}
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 	 */
410 410
 	public function save_points_type() {
411 411
 
412
-		if ( ! current_user_can( 'manage_wordpoints_points_types' ) ) {
412
+		if ( ! current_user_can('manage_wordpoints_points_types')) {
413 413
 			return;
414 414
 		}
415 415
 
@@ -424,43 +424,43 @@  discard block
 block discarded – undo
424 424
 
425 425
 			$settings = array();
426 426
 
427
-			$settings['name']   = trim( sanitize_text_field( wp_unslash( $_POST['points-name'] ) ) ); // WPCS: CSRF OK
428
-			$settings['prefix'] = ltrim( sanitize_text_field( wp_unslash( $_POST['points-prefix'] ) ) ); // WPCS: CSRF OK
429
-			$settings['suffix'] = rtrim( sanitize_text_field( wp_unslash( $_POST['points-suffix'] ) ) ); // WPCS: CSRF OK
427
+			$settings['name']   = trim(sanitize_text_field(wp_unslash($_POST['points-name']))); // WPCS: CSRF OK
428
+			$settings['prefix'] = ltrim(sanitize_text_field(wp_unslash($_POST['points-prefix']))); // WPCS: CSRF OK
429
+			$settings['suffix'] = rtrim(sanitize_text_field(wp_unslash($_POST['points-suffix']))); // WPCS: CSRF OK
430 430
 
431 431
 			if (
432
-				isset( $_POST['points-slug'] )
433
-				&& wordpoints_verify_nonce( 'update_points_type', 'wordpoints_update_points_type-%s', array( 'points-slug' ), 'post' )
432
+				isset($_POST['points-slug'])
433
+				&& wordpoints_verify_nonce('update_points_type', 'wordpoints_update_points_type-%s', array('points-slug'), 'post')
434 434
 			) {
435 435
 
436 436
 				// - We are updating an existing points type.
437 437
 
438
-				$points_type = sanitize_key( $_POST['points-slug'] );
438
+				$points_type = sanitize_key($_POST['points-slug']);
439 439
 
440
-				$old_settings = wordpoints_get_points_type( $points_type );
440
+				$old_settings = wordpoints_get_points_type($points_type);
441 441
 
442
-				if ( false === $old_settings ) {
442
+				if (false === $old_settings) {
443 443
 
444 444
 					add_settings_error(
445 445
 						''
446 446
 						, 'wordpoints_points_type_update'
447
-						, __( 'Error: failed updating points type.', 'wordpoints' )
447
+						, __('Error: failed updating points type.', 'wordpoints')
448 448
 						, 'updated'
449 449
 					);
450 450
 
451 451
 					return;
452 452
 				}
453 453
 
454
-				if ( is_array( $old_settings ) ) {
455
-					$settings = array_merge( $old_settings, $settings );
454
+				if (is_array($old_settings)) {
455
+					$settings = array_merge($old_settings, $settings);
456 456
 				}
457 457
 
458
-				if ( ! wordpoints_update_points_type( $points_type, $settings ) ) {
458
+				if ( ! wordpoints_update_points_type($points_type, $settings)) {
459 459
 
460 460
 					add_settings_error(
461 461
 						''
462 462
 						, 'wordpoints_points_type_update'
463
-						, __( 'Error: failed updating points type.', 'wordpoints' )
463
+						, __('Error: failed updating points type.', 'wordpoints')
464 464
 						, 'updated'
465 465
 					);
466 466
 
@@ -469,23 +469,23 @@  discard block
 block discarded – undo
469 469
 					add_settings_error(
470 470
 						''
471 471
 						, 'wordpoints_points_type_update'
472
-						, __( 'Points type updated.', 'wordpoints' )
472
+						, __('Points type updated.', 'wordpoints')
473 473
 						, 'updated'
474 474
 					);
475 475
 				}
476 476
 
477
-			} elseif ( wordpoints_verify_nonce( 'add_new', 'wordpoints_add_new_points_type', null, 'post' ) ) {
477
+			} elseif (wordpoints_verify_nonce('add_new', 'wordpoints_add_new_points_type', null, 'post')) {
478 478
 
479 479
 				// - We are creating a new points type.
480 480
 
481
-				$slug = wordpoints_add_points_type( $settings );
481
+				$slug = wordpoints_add_points_type($settings);
482 482
 
483
-				if ( ! $slug ) {
483
+				if ( ! $slug) {
484 484
 
485 485
 					add_settings_error(
486 486
 						''
487 487
 						, 'wordpoints_points_type_create'
488
-						, __( 'Please choose a unique name for this points type.', 'wordpoints' )
488
+						, __('Please choose a unique name for this points type.', 'wordpoints')
489 489
 					);
490 490
 
491 491
 				} else {
@@ -495,26 +495,26 @@  discard block
 block discarded – undo
495 495
 					add_settings_error(
496 496
 						''
497 497
 						, 'wordpoints_points_type_create'
498
-						, __( 'Points type created.', 'wordpoints' )
498
+						, __('Points type created.', 'wordpoints')
499 499
 						, 'updated'
500 500
 					);
501 501
 				}
502 502
 			}
503 503
 
504 504
 		} elseif (
505
-			! empty( $_POST['delete-points-type'] )
506
-			&& isset( $_POST['points-slug'] )
507
-			&& wordpoints_verify_nonce( 'delete-points-type-nonce', 'wordpoints_delete_points_type-%s', array( 'points-slug' ), 'post' )
505
+			! empty($_POST['delete-points-type'])
506
+			&& isset($_POST['points-slug'])
507
+			&& wordpoints_verify_nonce('delete-points-type-nonce', 'wordpoints_delete_points_type-%s', array('points-slug'), 'post')
508 508
 		) {
509 509
 
510 510
 			// - We are deleting a points type.
511 511
 
512
-			if ( wordpoints_delete_points_type( sanitize_key( $_POST['points-slug'] ) ) ) {
512
+			if (wordpoints_delete_points_type(sanitize_key($_POST['points-slug']))) {
513 513
 
514 514
 				add_settings_error(
515 515
 					''
516 516
 					, 'wordpoints_points_type_delete'
517
-					, __( 'Points type deleted.', 'wordpoints' )
517
+					, __('Points type deleted.', 'wordpoints')
518 518
 					, 'updated'
519 519
 				);
520 520
 
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 				add_settings_error(
524 524
 					''
525 525
 					, 'wordpoints_points_type_delete'
526
-					, __( 'Error while deleting.', 'wordpoints' )
526
+					, __('Error while deleting.', 'wordpoints')
527 527
 				);
528 528
 			}
529 529
 		}
@@ -539,25 +539,25 @@  discard block
 block discarded – undo
539 539
 		 *
540 540
 		 * @since 1.0.0
541 541
 		 */
542
-		do_action( 'wordpoints_admin_points_events_head' );
542
+		do_action('wordpoints_admin_points_events_head');
543 543
 
544
-		if ( is_network_admin() ) {
545
-			$title = __( 'Network Events', 'wordpoints' );
546
-			$description = __( 'Award points when various events happen on this network.', 'wordpoints' );
544
+		if (is_network_admin()) {
545
+			$title = __('Network Events', 'wordpoints');
546
+			$description = __('Award points when various events happen on this network.', 'wordpoints');
547 547
 		} else {
548
-			$title = __( 'Events', 'wordpoints' );
549
-			$description = __( 'Award points when various events happen on this site.', 'wordpoints' );
548
+			$title = __('Events', 'wordpoints');
549
+			$description = __('Award points when various events happen on this site.', 'wordpoints');
550 550
 		}
551 551
 
552
-		$points_type = wordpoints_get_points_type( $this->current_points_type );
552
+		$points_type = wordpoints_get_points_type($this->current_points_type);
553 553
 
554 554
 		?>
555 555
 
556 556
 		<div class="wordpoints-points-type-meta-box-wrap">
557 557
 
558 558
 				<form>
559
-					<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
560
-					<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
559
+					<?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?>
560
+					<?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?>
561 561
 				</form>
562 562
 
563 563
 				<div id="poststuff">
@@ -565,17 +565,17 @@  discard block
 block discarded – undo
565 565
 					<div id="post-body" class="metabox-holder columns-<?php echo 1 === (int) get_current_screen()->get_columns() ? '1' : '2'; ?>">
566 566
 
567 567
 						<div id="postbox-container-1" class="postbox-container">
568
-							<?php do_meta_boxes( $this->id, 'side', $points_type ); ?>
568
+							<?php do_meta_boxes($this->id, 'side', $points_type); ?>
569 569
 						</div>
570 570
 
571
-						<?php if ( isset( $this->current_points_type ) ) : ?>
571
+						<?php if (isset($this->current_points_type)) : ?>
572 572
 							<div class="wordpoints-hook-events-heading">
573
-								<h2><?php echo esc_html( $title ); ?></h2>
574
-								<p class="description"><?php echo esc_html( $description ); ?></p>
573
+								<h2><?php echo esc_html($title); ?></h2>
574
+								<p class="description"><?php echo esc_html($description); ?></p>
575 575
 							</div>
576 576
 
577 577
 							<div id="postbox-container-2" class="postbox-container">
578
-								<?php do_meta_boxes( $this->id, 'events', $points_type ); ?>
578
+								<?php do_meta_boxes($this->id, 'events', $points_type); ?>
579 579
 							</div>
580 580
 						<?php endif; ?>
581 581
 
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 		 *
595 595
 		 * @since 1.0.0
596 596
 		 */
597
-		do_action( 'wordpoints_admin_points_events_foot' );
597
+		do_action('wordpoints_admin_points_events_foot');
598 598
 	}
599 599
 }
600 600
 
Please login to merge, or discard this patch.