Completed
Branch TASK-10322-update-wp-version (96de15)
by
unknown
101:06 queued 90:50
created
core/libraries/batch/Helpers/JobParameters.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -214,7 +214,7 @@
 block discarded – undo
214 214
 	/**
215 215
 	 * Gets a single item from the request data
216 216
 	 * @param string $key
217
-	 * @param string|array $default
217
+	 * @param string $default
218 218
 	 * @return string|array
219 219
 	 */
220 220
 	function request_datum( $key, $default = '' ) {
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -96,12 +96,12 @@  discard block
 block discarded – undo
96 96
 	 * @param array $request_data
97 97
 	 * @param array $extra_data
98 98
 	 */
99
-	function __construct( $job_id, $classname, $request_data, $extra_data = array() ) {
100
-		$this->set_job_id( $job_id );
101
-		$this->set_classname( $classname );
102
-		$this->set_request_data( $request_data );
103
-		$this->set_extra_data( $extra_data );
104
-		$this->set_status( JobParameters::status_continue );
99
+	function __construct($job_id, $classname, $request_data, $extra_data = array()) {
100
+		$this->set_job_id($job_id);
101
+		$this->set_classname($classname);
102
+		$this->set_request_data($request_data);
103
+		$this->set_extra_data($extra_data);
104
+		$this->set_status(JobParameters::status_continue);
105 105
 	}
106 106
 
107 107
 
@@ -126,12 +126,12 @@  discard block
 block discarded – undo
126 126
 	 * @param boolean $first
127 127
 	 * @return boolean success
128 128
 	 */
129
-	function save( $first = false ) {
130
-		$object_vars = wp_json_encode( get_object_vars( $this ) );
131
-		if( $first ) {
132
-			return add_option( $this->option_name(), $object_vars, null, 'no' );
133
-		} else{
134
-			return update_option( $this->option_name(), $object_vars );
129
+	function save($first = false) {
130
+		$object_vars = wp_json_encode(get_object_vars($this));
131
+		if ($first) {
132
+			return add_option($this->option_name(), $object_vars, null, 'no');
133
+		} else {
134
+			return update_option($this->option_name(), $object_vars);
135 135
 		}
136 136
 	}
137 137
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 * @return boolean
144 144
 	 */
145 145
 	function delete() {
146
-		return delete_option( $this->option_name() );
146
+		return delete_option($this->option_name());
147 147
 	}
148 148
 
149 149
 
@@ -154,26 +154,26 @@  discard block
 block discarded – undo
154 154
 	 * @return JobParameters
155 155
 	 * @throws BatchRequestException
156 156
 	 */
157
-	static function load( $job_id ) {
158
-		$job_parameter_vars = json_decode( get_option( JobParameters::wp_option_prefix . $job_id ), true );
159
-		if(
160
-			! is_array( $job_parameter_vars ) ||
161
-			! isset( $job_parameter_vars[ '_classname' ] ) ||
162
-			! isset( $job_parameter_vars[ '_request_data' ] )
157
+	static function load($job_id) {
158
+		$job_parameter_vars = json_decode(get_option(JobParameters::wp_option_prefix.$job_id), true);
159
+		if (
160
+			! is_array($job_parameter_vars) ||
161
+			! isset($job_parameter_vars['_classname']) ||
162
+			! isset($job_parameter_vars['_request_data'])
163 163
 		) {
164 164
 			throw new BatchRequestException(
165 165
 				sprintf(
166 166
 					__('Could not retrieve job %1$s from the Wordpress options table, and so the job could not continue. The wordpress option was %2$s', 'event_espresso'),
167 167
 					$job_id,
168
-					get_option( JobParameters::wp_option_prefix . $job_id )
168
+					get_option(JobParameters::wp_option_prefix.$job_id)
169 169
 				)
170 170
 			);
171 171
 		}
172 172
 		$job_parameters = new JobParameters(
173 173
 				$job_id,
174
-				$job_parameter_vars[ '_classname' ],
175
-				$job_parameter_vars[ '_request_data'] );
176
-		foreach( $job_parameter_vars as $key => $value ) {
174
+				$job_parameter_vars['_classname'],
175
+				$job_parameter_vars['_request_data'] );
176
+		foreach ($job_parameter_vars as $key => $value) {
177 177
 			$job_parameters->{$key} = $value;
178 178
 		}
179 179
 		return $job_parameters;
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
 	 * @param string|array $default
218 218
 	 * @return string|array
219 219
 	 */
220
-	function request_datum( $key, $default = '' ) {
221
-		if( isset( $this->_request_data[ $key ] ) ) {
222
-			return $this->_request_data[ $key ];
220
+	function request_datum($key, $default = '') {
221
+		if (isset($this->_request_data[$key])) {
222
+			return $this->_request_data[$key];
223 223
 		} else {
224 224
 			return $default;
225 225
 		}
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
 	 * @param string|array $default
234 234
 	 * @return string|array
235 235
 	 */
236
-	function extra_datum( $key, $default = '' ) {
237
-		if( isset( $this->_extra_data[ $key ] ) ) {
238
-			return $this->_extra_data[ $key ];
236
+	function extra_datum($key, $default = '') {
237
+		if (isset($this->_extra_data[$key])) {
238
+			return $this->_extra_data[$key];
239 239
 		} else {
240 240
 			return $default;
241 241
 		}
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
 	 * @param string $key
249 249
 	 * @param string|int|array|null $value almost any extra data you want to store
250 250
 	 */
251
-	function add_extra_data( $key, $value ) {
252
-		$this->_extra_data[ $key ] = $value;
251
+	function add_extra_data($key, $value) {
252
+		$this->_extra_data[$key] = $value;
253 253
 	}
254 254
 
255 255
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 * Sets the job size. You decide what units to use
279 279
 	 * @param int $size
280 280
 	 */
281
-	function set_job_size( $size ) {
281
+	function set_job_size($size) {
282 282
 		$this->_job_size = $size;
283 283
 	}
284 284
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	 * @param int $newly_processed
300 300
 	 * @return int updated units processed
301 301
 	 */
302
-	function mark_processed( $newly_processed ) {
302
+	function mark_processed($newly_processed) {
303 303
 		$this->_units_processed += $newly_processed;
304 304
 		return $this->_units_processed;
305 305
 	}
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 	 * Sets the total count of units processed. You might prefer to use mark_processed
311 311
 	 * @param int $total_units_processed
312 312
 	 */
313
-	function set_units_processed( $total_units_processed ) {
313
+	function set_units_processed($total_units_processed) {
314 314
 		$this->_units_processed = $total_units_processed;
315 315
 	}
316 316
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 	 * Sets the job's ID
321 321
 	 * @param string $job_id
322 322
 	 */
323
-	function set_job_id( $job_id ) {
323
+	function set_job_id($job_id) {
324 324
 		$this->_job_id = $job_id;
325 325
 	}
326 326
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	 * sets the classname
331 331
 	 * @param string $classname
332 332
 	 */
333
-	function set_classname( $classname ) {
333
+	function set_classname($classname) {
334 334
 		$this->_classname = $classname;
335 335
 	}
336 336
 
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 	 * Sets the request data
341 341
 	 * @param array $request_data
342 342
 	 */
343
-	function set_request_data( $request_data ) {
343
+	function set_request_data($request_data) {
344 344
 		$this->_request_data = $request_data;
345 345
 	}
346 346
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 	 * Sets the array of extra data we want to store on this request
351 351
 	 * @param array $extra_data
352 352
 	 */
353
-	function set_extra_data( $extra_data ) {
353
+	function set_extra_data($extra_data) {
354 354
 		$this->_extra_data = $extra_data;
355 355
 	}
356 356
 
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	 * @return string
362 362
 	 */
363 363
 	function option_name() {
364
-		return JobParameters::wp_option_prefix . $this->job_id();
364
+		return JobParameters::wp_option_prefix.$this->job_id();
365 365
 	}
366 366
 
367 367
 
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 	 *
381 381
 	 * @param string $status on eof JobParameters::valid_stati()
382 382
 	 */
383
-	public function set_status( $status ) {
383
+	public function set_status($status) {
384 384
 		$this->_status = $status;
385 385
 	}
386 386
 
Please login to merge, or discard this patch.
core/libraries/rest_api/controllers/model/Base.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
 	protected $_model_version_info;
27 27
 
28 28
 /**
29
-	 * Sets the version the user requested
30
-	 * @param string $version eg '4.8'
31
-	 */
29
+ * Sets the version the user requested
30
+ * @param string $version eg '4.8'
31
+ */
32 32
 	public function set_requested_version( $version ) {
33 33
 		parent::set_requested_version( $version );
34 34
 		$this->_model_version_info = new Model_Version_Info( $version );
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 use EventEspresso\core\libraries\rest_api\controllers\Base as Controller_Base;
4 4
 use EventEspresso\core\libraries\rest_api\Model_Version_Info;
5 5
 
6
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
7
-	exit( 'No direct script access allowed' );
6
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
7
+	exit('No direct script access allowed');
8 8
 }
9 9
 
10 10
 /**
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 	 * Sets the version the user requested
30 30
 	 * @param string $version eg '4.8'
31 31
 	 */
32
-	public function set_requested_version( $version ) {
33
-		parent::set_requested_version( $version );
34
-		$this->_model_version_info = new Model_Version_Info( $version );
32
+	public function set_requested_version($version) {
33
+		parent::set_requested_version($version);
34
+		$this->_model_version_info = new Model_Version_Info($version);
35 35
 	}
36 36
 
37 37
 
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 	 * @return \EventEspresso\core\libraries\rest_api\Model_Version_Info
44 44
 	 * @throws \EE_Error
45 45
 	 */
46
-	public function get_model_version_info(){
47
-		if( ! $this->_model_version_info ) {
46
+	public function get_model_version_info() {
47
+		if ( ! $this->_model_version_info) {
48 48
 			throw new \EE_Error(
49 49
 				sprintf(
50 50
 					__(
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
 	 * @param array $classnames
67 67
 	 * @return boolean
68 68
 	 */
69
-	public function is_subclass_of_one( $object, $classnames ) {
70
-		foreach( $classnames as $classname ) {
71
-			if( is_a( $object, $classname ) ) {
69
+	public function is_subclass_of_one($object, $classnames) {
70
+		foreach ($classnames as $classname) {
71
+			if (is_a($object, $classname)) {
72 72
 				return true;
73 73
 			}
74 74
 		}
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 	 * in_array(), except this checks if $object is a subclass of the classnames provided
63 63
 	 * in $classnames
64 64
 	 *
65
-	 * @param object $object
65
+	 * @param \EE_Model_Field_Base $object
66 66
 	 * @param array $classnames
67 67
 	 * @return boolean
68 68
 	 */
Please login to merge, or discard this patch.
4_9_0_stages/EE_DMS_4_9_0_Answers_With_No_Registration.dmsstage.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION')) {
3
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5 5
 }
6 6
 
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * @author				Brent Christensen
15 15
  *
16 16
  */
17
-class EE_DMS_4_9_0_Answers_With_No_Registration extends EE_Data_Migration_Script_Stage{
17
+class EE_DMS_4_9_0_Answers_With_No_Registration extends EE_Data_Migration_Script_Stage {
18 18
 
19 19
 
20 20
 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 * @return EE_DMS_4_9_0_Answers_With_No_Registration
25 25
 	 */
26 26
 	public function __construct() {
27
-		$this->_pretty_name = __( 'Answer Cleanup', 'event_espresso' );
27
+		$this->_pretty_name = __('Answer Cleanup', 'event_espresso');
28 28
 		parent::__construct();
29 29
 	}
30 30
 
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	protected function _migration_step($num_items_to_migrate = 50) {
49 49
 		global $wpdb;
50 50
 		$wpdb->delete(
51
-			$wpdb->prefix . 'esp_answer',
52
-			array( 'REG_ID' => 0 ),
53
-			array( '%d' )
51
+			$wpdb->prefix.'esp_answer',
52
+			array('REG_ID' => 0),
53
+			array('%d')
54 54
 		);
55 55
 		$this->set_completed();
56 56
 		return 1;
Please login to merge, or discard this patch.
core/db_models/EEM_Extra_Meta.model.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * ------------------------------------------------------------------------
28 28
  */
29
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
29
+require_once (EE_MODELS.'EEM_Base.model.php');
30 30
 
31 31
 class EEM_Extra_Meta extends EEM_Base {
32 32
 
33 33
   	// private instance of the Attendee object
34 34
 	protected static $_instance = NULL;
35 35
 
36
-	protected function __construct( $timezone = NULL ) {
37
-		$this->singular_item = __('Extra Meta','event_espresso');
38
-		$this->plural_item = __('Extra Metas','event_espresso');
36
+	protected function __construct($timezone = NULL) {
37
+		$this->singular_item = __('Extra Meta', 'event_espresso');
38
+		$this->plural_item = __('Extra Metas', 'event_espresso');
39 39
 		$this->_tables = array(
40 40
 			'Extra_Meta'=> new EE_Primary_Table('esp_extra_meta', 'EXM_ID')
41 41
 		);
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
 
51 51
 			));
52 52
 		$this->_model_relations = array();
53
-		foreach($models_this_can_attach_to as $model){
53
+		foreach ($models_this_can_attach_to as $model) {
54 54
 			$this->_model_relations[$model] = new EE_Belongs_To_Any_Relation();
55 55
 		}
56
-		foreach( $this->cap_contexts_to_cap_action_map() as $cap_context => $action ) {
57
-			$this->_cap_restriction_generators[ $cap_context ] = new EE_Restriction_Generator_Meta( 'EXM_key', 'EXM_value' );
56
+		foreach ($this->cap_contexts_to_cap_action_map() as $cap_context => $action) {
57
+			$this->_cap_restriction_generators[$cap_context] = new EE_Restriction_Generator_Meta('EXM_key', 'EXM_value');
58 58
 		}
59
-		parent::__construct( $timezone );
59
+		parent::__construct($timezone);
60 60
 	}
61 61
 
62 62
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
core/db_models/EEM_Post_Meta.model.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,20 +31,20 @@  discard block
 block discarded – undo
31 31
  *
32 32
  * ------------------------------------------------------------------------
33 33
  */
34
-require_once ( EE_MODELS . 'EEM_Base.model.php' );
34
+require_once (EE_MODELS.'EEM_Base.model.php');
35 35
 
36 36
 class EEM_Post_Meta extends EEM_Base {
37 37
 
38 38
   	// private instance of the EE_Post_Meta object
39 39
 	protected static $_instance = NULL;
40 40
 
41
-	protected function __construct( $timezone = NULL ) {
42
-		$this->singular_item = __('Post Meta','event_espresso');
43
-		$this->plural_item = __('Post Metas','event_espresso');
41
+	protected function __construct($timezone = NULL) {
42
+		$this->singular_item = __('Post Meta', 'event_espresso');
43
+		$this->plural_item = __('Post Metas', 'event_espresso');
44 44
 		$this->_tables = array(
45 45
 			'Post_Meta'=> new EE_Primary_Table('postmeta', 'meta_id')
46 46
 		);
47
-		$models_this_can_attach_to = array_keys( EE_Registry::instance()->cpt_models() );
47
+		$models_this_can_attach_to = array_keys(EE_Registry::instance()->cpt_models());
48 48
 		$this->_fields = array(
49 49
 			'Post_Meta'=>array(
50 50
 				'meta_id'=>new EE_Primary_Key_Int_Field('meta_id', __("Meta ID", "event_espresso")),
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 				'meta_value'=>new EE_Maybe_Serialized_Text_Field('meta_value', __("Meta Value", "event_espresso"), true)
54 54
 			));
55 55
 		$this->_model_relations = array();
56
-		foreach($models_this_can_attach_to as $model){
56
+		foreach ($models_this_can_attach_to as $model) {
57 57
 			$this->_model_relations[$model] = new EE_Belongs_To_Relation();
58 58
 		}
59
-		foreach( $this->cap_contexts_to_cap_action_map() as $cap_context => $action ) {
60
-			$this->_cap_restriction_generators[ $cap_context ] = new EE_Restriction_Generator_Meta( 'meta_key', 'meta_value' );
59
+		foreach ($this->cap_contexts_to_cap_action_map() as $cap_context => $action) {
60
+			$this->_cap_restriction_generators[$cap_context] = new EE_Restriction_Generator_Meta('meta_key', 'meta_value');
61 61
 		}
62
-		parent::__construct( $timezone );
62
+		parent::__construct($timezone);
63 63
 	}
64 64
 
65 65
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.
core/db_models/strategies/EE_Restriction_Generator_Meta.strategy.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * @author				Mike Nelson
15 15
  *
16 16
  */
17
-class EE_Restriction_Generator_Meta extends EE_Restriction_Generator_Base{
17
+class EE_Restriction_Generator_Meta extends EE_Restriction_Generator_Base {
18 18
 
19 19
 	/**
20 20
 	 *
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @param string $key_field_name
34 34
 	 * @param string $value_field_name
35 35
 	 */
36
-	public function __construct( $key_field_name, $value_field_name ) {
36
+	public function __construct($key_field_name, $value_field_name) {
37 37
 		$this->_key_field_name = $key_field_name;
38 38
 		$this->_value_field_name = $value_field_name;
39 39
 	}
@@ -45,21 +45,21 @@  discard block
 block discarded – undo
45 45
 	 * @throws EE_Error
46 46
 	 */
47 47
 	protected function _generate_restrictions() {
48
-		$whitelisted_meta_keys = apply_filters( 'FHEE__EE_Restriction_Generator_Meta___generate_restrictions__whitelisted_meta_keys', array() );
49
-		$blacklisted_meta_keys = apply_filters( 'FHEE__EE_Restriction_Generator_Meta___generate_restrictions__blacklisted_meta_keys', array() );
48
+		$whitelisted_meta_keys = apply_filters('FHEE__EE_Restriction_Generator_Meta___generate_restrictions__whitelisted_meta_keys', array());
49
+		$blacklisted_meta_keys = apply_filters('FHEE__EE_Restriction_Generator_Meta___generate_restrictions__blacklisted_meta_keys', array());
50 50
 		$conditions = array(
51
-			$this->_key_field_name => array( 'NOT_LIKE', "\\\\_%" ),//each slash is escaped because we are using double quotes, and 
51
+			$this->_key_field_name => array('NOT_LIKE', "\\\\_%"), //each slash is escaped because we are using double quotes, and 
52 52
 			//stripslashes will be called on this because the models assume this is from user input
53
-			$this->_value_field_name => array( 'NOT_REGEXP', '^[aOs]:[\d]:.*$')					
53
+			$this->_value_field_name => array('NOT_REGEXP', '^[aOs]:[\d]:.*$')					
54 54
 		);
55
-		if( ! empty( $blacklisted_meta_keys ) ) {
56
-			$conditions[ $this->_key_field_name . '*blacklisted' ] = array( 'NOT_IN', $blacklisted_meta_keys );
55
+		if ( ! empty($blacklisted_meta_keys)) {
56
+			$conditions[$this->_key_field_name.'*blacklisted'] = array('NOT_IN', $blacklisted_meta_keys);
57 57
 		}
58
-		if( ! empty( $whitelisted_meta_keys ) ) {
58
+		if ( ! empty($whitelisted_meta_keys)) {
59 59
 			$conditions = array(
60 60
 				'OR*whitelisted-or-normal' => array(
61 61
 					'AND' => $conditions,
62
-					$this->_key_field_name . '*whitelisted' => array( 'IN', $whitelisted_meta_keys ) 
62
+					$this->_key_field_name.'*whitelisted' => array('IN', $whitelisted_meta_keys) 
63 63
 				)
64 64
 			);
65 65
 		}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 			//only allow access to non-protected metas if they're an admin
68 68
 			EE_Restriction_Generator_Base::get_default_restrictions_cap() => new EE_Return_None_Where_Conditions(),
69 69
 			//don't allow access to protected metas to anyone. If they want that, don't apply caps to the query
70
-			'apply-to-all-queries-using-caps' => new EE_Default_Where_Conditions( $conditions ),
70
+			'apply-to-all-queries-using-caps' => new EE_Default_Where_Conditions($conditions),
71 71
 		);
72 72
 	}
73 73
 }
Please login to merge, or discard this patch.
core/libraries/rest_api/controllers/Base.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
 	 *
130 130
 	 * @param string $route
131 131
 	 * @param string $regex
132
-	 * @param array  $match_keys EXCLUDING matching the entire regex
132
+	 * @param string[]  $match_keys EXCLUDING matching the entire regex
133 133
 	 * @return array where  $match_keys are the keys (the first value of $match_keys
134 134
 	 * becomes the first key of the return value, etc. Eg passing in $match_keys of
135 135
 	 * array( 'model', 'id' ), will, if the regex is successful, will return
Please login to merge, or discard this patch.
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\libraries\rest_api\controllers;
3 3
 use EventEspresso\core\libraries\rest_api\Rest_Exception;
4
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
5
-	exit( 'No direct script access allowed' );
4
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 /**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 
51 51
 	public function __construct() {
52
-		$this->_debug_mode = defined( 'EE_REST_API_DEBUG_MODE' ) ? EE_REST_API_DEBUG_MODE : false;
52
+		$this->_debug_mode = defined('EE_REST_API_DEBUG_MODE') ? EE_REST_API_DEBUG_MODE : false;
53 53
 	}
54 54
 
55 55
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 * Sets the version the user requested
58 58
 	 * @param string $version eg '4.8'
59 59
 	 */
60
-	public function set_requested_version( $version ) {
60
+	public function set_requested_version($version) {
61 61
 		$this->_requested_version = $version;
62 62
 	}
63 63
 
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 	 * @param string $key
67 67
 	 * @param string|array $info
68 68
 	 */
69
-	protected function _set_debug_info( $key, $info ){
70
-		$this->_debug_info[ $key ] = $info;
69
+	protected function _set_debug_info($key, $info) {
70
+		$this->_debug_info[$key] = $info;
71 71
 	}
72 72
 
73 73
 	/**
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
 	 * @param boolean      $use_ee_prefix whether to use the EE prefix on the header, or fallback to
80 80
 	 *                                    the standard WP one
81 81
 	 */
82
-	protected function _set_response_header( $header_key, $value, $use_ee_prefix = true ) {
83
-		if( is_array( $value ) ) {
84
-			foreach( $value as $value_key => $value_value ) {
85
-				$this->_set_response_header(  $header_key . '[' . $value_key . ']', $value_value );
82
+	protected function _set_response_header($header_key, $value, $use_ee_prefix = true) {
83
+		if (is_array($value)) {
84
+			foreach ($value as $value_key => $value_value) {
85
+				$this->_set_response_header($header_key.'['.$value_key.']', $value_value);
86 86
 			}
87 87
 		} else {
88 88
 			$prefix = $use_ee_prefix ? Base::header_prefix_for_ee : Base::header_prefix_for_wp;
89
-			$this->_response_headers[ $prefix . $header_key  ] = $value;
89
+			$this->_response_headers[$prefix.$header_key] = $value;
90 90
 		}
91 91
 	}
92 92
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 * @return array
96 96
 	 */
97 97
 	protected function _get_response_headers() {
98
-		return apply_filters( 'FHEE__EventEspresso\core\libraries\rest_api\controllers\Base___get_response_headers',
98
+		return apply_filters('FHEE__EventEspresso\core\libraries\rest_api\controllers\Base___get_response_headers',
99 99
 			$this->_response_headers,
100 100
 			$this,
101 101
 			$this->_requested_version
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
 	 * @param \WP_Error $wp_error_response
108 108
 	 * @return \WP_Error
109 109
 	 */
110
-	protected function _add_ee_errors_to_response( \WP_Error $wp_error_response ) {
110
+	protected function _add_ee_errors_to_response(\WP_Error $wp_error_response) {
111 111
 		$notices_during_checkin = \EE_Error::get_raw_notices();
112
-		if( ! empty( $notices_during_checkin[ 'errors' ] ) ) {
113
-			foreach( $notices_during_checkin[ 'errors' ] as $error_code => $error_message ) {
112
+		if ( ! empty($notices_during_checkin['errors'])) {
113
+			foreach ($notices_during_checkin['errors'] as $error_code => $error_message) {
114 114
 				$wp_error_response->add(
115
-					sanitize_key( $error_code ),
116
-					strip_tags( $error_message ) );
115
+					sanitize_key($error_code),
116
+					strip_tags($error_message) );
117 117
 			}
118 118
 		}
119 119
 		return $wp_error_response;
@@ -131,27 +131,27 @@  discard block
 block discarded – undo
131 131
 	 * @param array|\WP_Error|\Exception $response
132 132
 	 * @return \WP_REST_Response
133 133
 	 */
134
-	public function send_response( $response ) {
135
-		if( $response instanceof Rest_Exception ) {
136
-			$response = new \WP_Error( $response->get_string_code(), $response->getMessage(), $response->get_data() );
134
+	public function send_response($response) {
135
+		if ($response instanceof Rest_Exception) {
136
+			$response = new \WP_Error($response->get_string_code(), $response->getMessage(), $response->get_data());
137 137
 		}
138
-		if( $response instanceof \Exception ) {
138
+		if ($response instanceof \Exception) {
139 139
 			$code = $response->getCode() ? $response->getCode() : 'error_occurred';
140
-			$response = new \WP_Error( $code, $response->getMessage() );
140
+			$response = new \WP_Error($code, $response->getMessage());
141 141
 		}
142
-		if( $response instanceof \WP_Error ) {
143
-			$response = $this->_add_ee_errors_to_response( $response );
144
-			$rest_response = $this->_create_rest_response_from_wp_error( $response );
145
-		}else{
146
-			$rest_response = new \WP_REST_Response( $response, 200 );
142
+		if ($response instanceof \WP_Error) {
143
+			$response = $this->_add_ee_errors_to_response($response);
144
+			$rest_response = $this->_create_rest_response_from_wp_error($response);
145
+		} else {
146
+			$rest_response = new \WP_REST_Response($response, 200);
147 147
 		}
148 148
 		$headers = array();
149
-		if( $this->_debug_mode && is_array( $this->_debug_info ) ) {
150
-			foreach( $this->_debug_info  as $debug_key => $debug_info ) {
151
-				if( is_array( $debug_info ) ) {
152
-					$debug_info = wp_json_encode( $debug_info );
149
+		if ($this->_debug_mode && is_array($this->_debug_info)) {
150
+			foreach ($this->_debug_info  as $debug_key => $debug_info) {
151
+				if (is_array($debug_info)) {
152
+					$debug_info = wp_json_encode($debug_info);
153 153
 				}
154
-				$headers[ 'X-EE4-Debug-' . ucwords( $debug_key ) ] = $debug_info;
154
+				$headers['X-EE4-Debug-'.ucwords($debug_key)] = $debug_info;
155 155
 			}
156 156
 		}
157 157
 		$headers = array_merge(
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 			$this->_get_headers_from_ee_notices()
161 161
 		);
162 162
 
163
-		$rest_response->set_headers( $headers );
163
+		$rest_response->set_headers($headers);
164 164
 		return $rest_response;
165 165
 	}
166 166
 
@@ -171,31 +171,31 @@  discard block
 block discarded – undo
171 171
 	 * @param \WP_Error $wp_error
172 172
 	 * @return \WP_REST_Response
173 173
 	 */
174
-	protected function _create_rest_response_from_wp_error( \WP_Error $wp_error ) {
174
+	protected function _create_rest_response_from_wp_error(\WP_Error $wp_error) {
175 175
 		$error_data = $wp_error->get_error_data();
176
-		if ( is_array( $error_data ) && isset( $error_data['status'] ) ) {
176
+		if (is_array($error_data) && isset($error_data['status'])) {
177 177
 			$status = $error_data['status'];
178 178
 		} else {
179 179
 			$status = 500;
180 180
 		}
181 181
 
182 182
 		$errors = array();
183
-		foreach ( (array) $wp_error->errors as $code => $messages ) {
184
-			foreach ( (array) $messages as $message ) {
183
+		foreach ((array) $wp_error->errors as $code => $messages) {
184
+			foreach ((array) $messages as $message) {
185 185
 				$errors[] = array(
186 186
 					'code'    => $code,
187 187
 					'message' => $message,
188
-					'data'    => $wp_error->get_error_data( $code )
188
+					'data'    => $wp_error->get_error_data($code)
189 189
 				);
190 190
 			}
191 191
 		}
192
-		$data = isset( $errors[0] ) ? $errors[0] : array();
193
-		if ( count( $errors ) > 1 ) {
192
+		$data = isset($errors[0]) ? $errors[0] : array();
193
+		if (count($errors) > 1) {
194 194
 			// Remove the primary error.
195
-			array_shift( $errors );
195
+			array_shift($errors);
196 196
 			$data['additional_errors'] = $errors;
197 197
 		}
198
-		return new \WP_REST_Response( $data, $status );
198
+		return new \WP_REST_Response($data, $status);
199 199
 	}
200 200
 
201 201
 	/**
@@ -205,12 +205,12 @@  discard block
 block discarded – undo
205 205
 	protected function _get_headers_from_ee_notices() {
206 206
 		$headers = array();
207 207
 		$notices = \EE_Error::get_raw_notices();
208
-		foreach( $notices as $notice_type => $sub_notices ) {
209
-			if( ! is_array( $sub_notices ) ) {
208
+		foreach ($notices as $notice_type => $sub_notices) {
209
+			if ( ! is_array($sub_notices)) {
210 210
 				continue;
211 211
 			}
212
-			foreach( $sub_notices as $notice_code => $sub_notice ) {
213
-				$headers[ 'X-EE4-Notices-' . \EEH_Inflector::humanize( $notice_type ) . '[' . $notice_code . ']' ] = strip_tags( $sub_notice );
212
+			foreach ($sub_notices as $notice_code => $sub_notice) {
213
+				$headers['X-EE4-Notices-'.\EEH_Inflector::humanize($notice_type).'['.$notice_code.']'] = strip_tags($sub_notice);
214 214
 			}
215 215
 		}
216 216
 		return apply_filters(
@@ -228,14 +228,14 @@  discard block
 block discarded – undo
228 228
 	 * @param string $route
229 229
 	 * @return string
230 230
 	 */
231
-	public function get_requested_version( $route = null ) {
231
+	public function get_requested_version($route = null) {
232 232
 		$matches = $this->parse_route(
233 233
 			$route,
234
-			'~' . \EED_Core_Rest_Api::ee_api_namespace_for_regex . '~',
235
-			array( 'version' )
234
+			'~'.\EED_Core_Rest_Api::ee_api_namespace_for_regex.'~',
235
+			array('version')
236 236
 			);
237
-		if( isset( $matches[ 'version' ] ) ) {
238
-			return $matches[ 'version' ];
237
+		if (isset($matches['version'])) {
238
+			return $matches['version'];
239 239
 		} else {
240 240
 			return \EED_Core_Rest_Api::latest_rest_api_version();
241 241
 		}
@@ -260,23 +260,23 @@  discard block
 block discarded – undo
260 260
 	 * array( 'model' => 'foo', 'id' => 'bar' )
261 261
 	 * @throws \EE_Error if it couldn't be parsed
262 262
 	 */
263
-	public function parse_route( $route, $regex, $match_keys ) {
263
+	public function parse_route($route, $regex, $match_keys) {
264 264
 		$indexed_matches = array();
265
-		$success = preg_match( $regex, $route, $matches );
266
-		if(
267
-			is_array( $matches ) ) {
265
+		$success = preg_match($regex, $route, $matches);
266
+		if (
267
+			is_array($matches) ) {
268 268
 			//skip the overall regex match. Who cares
269
-			for( $i = 1; $i <= count( $match_keys ); $i++ ) {
270
-				if( ! isset( $matches[ $i ] ) ) {
269
+			for ($i = 1; $i <= count($match_keys); $i++) {
270
+				if ( ! isset($matches[$i])) {
271 271
 					$success = false;
272 272
 				} else {
273
-					$indexed_matches[ $match_keys[ $i - 1 ] ] = $matches[ $i ];
273
+					$indexed_matches[$match_keys[$i - 1]] = $matches[$i];
274 274
 				}
275 275
 			}
276 276
 		}
277
-		if( ! $success ) {
277
+		if ( ! $success) {
278 278
 			throw new \EE_Error(
279
-				__( 'We could not parse the URL. Please contact Event Espresso Support', 'event_espresso' ),
279
+				__('We could not parse the URL. Please contact Event Espresso Support', 'event_espresso'),
280 280
 				'endpoint_parsing_error'
281 281
 			);
282 282
 		}
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
 		if( $response instanceof \WP_Error ) {
143 143
 			$response = $this->_add_ee_errors_to_response( $response );
144 144
 			$rest_response = $this->_create_rest_response_from_wp_error( $response );
145
-		}else{
145
+		} else{
146 146
 			$rest_response = new \WP_REST_Response( $response, 200 );
147 147
 		}
148 148
 		$headers = array();
Please login to merge, or discard this patch.
core/db_models/strategies/EE_CPT_Minimum_Where_Conditions.strategy.php 3 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,6 +7,10 @@  discard block
 block discarded – undo
7 7
 
8 8
 	protected $_post_type;
9 9
 	protected $_meta_field;
10
+
11
+	/**
12
+	 * @param string $post_type
13
+	 */
10 14
 	function __construct($post_type, $meta_field_to_chk = ''){
11 15
 		$this->_post_type = $post_type;
12 16
 		$this->_meta_field = $meta_field_to_chk;
@@ -27,7 +31,6 @@  discard block
 block discarded – undo
27 31
 	}
28 32
 	/**
29 33
 	 * Gets the where default where conditions for a custom post type model
30
-	 * @param string $model_relation_path. Eg, from Event to Payment, this should be "Registration.Transaction.Payment"
31 34
 	 * @return array like EEM_Base::get_all's $query_params's index [0] (where conditions)
32 35
 	 */
33 36
 	protected function _get_default_where_conditions() {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 /**
6 6
  *
@@ -15,11 +15,11 @@  discard block
 block discarded – undo
15 15
  * @since		 	   4.8.29.rc.010
16 16
  *
17 17
  */
18
-class EE_CPT_Minimum_Where_Conditions extends EE_Default_Where_Conditions{
18
+class EE_CPT_Minimum_Where_Conditions extends EE_Default_Where_Conditions {
19 19
 
20 20
 	protected $_post_type;
21 21
 	protected $_meta_field;
22
-	function __construct($post_type, $meta_field_to_chk = ''){
22
+	function __construct($post_type, $meta_field_to_chk = '') {
23 23
 		$this->_post_type = $post_type;
24 24
 		$this->_meta_field = $meta_field_to_chk;
25 25
 	}
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	 * @param string $column column name
30 30
 	 * @return EE_Model_Field_Base
31 31
 	 */
32
-	protected function _get_field_on_column($column){
32
+	protected function _get_field_on_column($column) {
33 33
 		$all_fields = $this->_model->field_settings(true);
34
-		foreach($all_fields as $field_name => $field_obj){
35
-			if($column == $field_obj->get_table_column()){
34
+		foreach ($all_fields as $field_name => $field_obj) {
35
+			if ($column == $field_obj->get_table_column()) {
36 36
 				return $field_obj;
37 37
 			}
38 38
 		}
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 /**
6 6
  *
7 7
  * Class EE_CPT_Minimum_Where_Conditions
8
-  * 
8
+ * 
9 9
  * Strategy specifically for adding where conditions specific to CPT models.
10 10
  * But only sets the minimum, so any row of the right type will get used
11 11
  *
Please login to merge, or discard this patch.
core/db_models/strategies/EE_CPT_Where_Conditions.strategy.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
 class EE_CPT_Where_Conditions extends EE_CPT_Minimum_Where_Conditions{
18 18
 	/**
19 19
 	 * Gets the where default where conditions for a custom post type model
20
-	 * @param string $model_relation_path. Eg, from Event to Payment, this should be "Registration.Transaction.Payment"
21 20
 	 * @return array like EEM_Base::get_all's $query_params's index [0] (where conditions)
22 21
 	 */
23 22
 	protected function _get_default_where_conditions() {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 /**
6 6
  *
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
  * * @since		 	   4.6.0
15 15
  *
16 16
  */
17
-class EE_CPT_Where_Conditions extends EE_CPT_Minimum_Where_Conditions{
17
+class EE_CPT_Where_Conditions extends EE_CPT_Minimum_Where_Conditions {
18 18
 	/**
19 19
 	 * Gets the where default where conditions for a custom post type model
20 20
 	 * @param string $model_relation_path. Eg, from Event to Payment, this should be "Registration.Transaction.Payment"
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 		return array_merge( 
26 26
 			parent::_get_default_where_conditions(),
27 27
 			array( 
28
-				$status_field->get_name() => array('NOT IN',array('auto-draft','trash') )
28
+				$status_field->get_name() => array('NOT IN', array('auto-draft', 'trash'))
29 29
 			)
30 30
 		);
31 31
 	}
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
 /**
6 6
  *
7 7
  * Class EE_Default_Where_Conditions
8
-  * 
8
+ * 
9 9
  * Strategy specifically for adding where conditions specific to CPT models.
10 10
  *
11 11
  * @package         Event Espresso
Please login to merge, or discard this patch.