Completed
Branch FET/10766/extract-activation-d... (f6eee0)
by
unknown
13:03 queued 10:52
created
core/db_classes/EE_Ticket_Price.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1
-<?php if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) {
2
-	exit( 'No direct script access allowed' );
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 /**
5 5
  * Event Espresso
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
 	 * @param string $timezone
36 36
 	 * @return EE_Ticket_Price|mixed
37 37
 	 */
38
-	public static function new_instance( $props_n_values = array(), $timezone = '', $date_formats = array() ) {
39
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
40
-		return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone, $date_formats );
38
+	public static function new_instance($props_n_values = array(), $timezone = '', $date_formats = array()) {
39
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
40
+		return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone, $date_formats);
41 41
 	}
42 42
 
43 43
 
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	 * @param string $timezone
48 48
 	 * @return EE_Ticket_Price
49 49
 	 */
50
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) {
51
-		return new self( $props_n_values, TRUE, $timezone );
50
+	public static function new_instance_from_db($props_n_values = array(), $timezone = '') {
51
+		return new self($props_n_values, TRUE, $timezone);
52 52
 	}
53 53
 
54 54
 
Please login to merge, or discard this patch.
core/libraries/qtips/EE_Qtip_Config.lib.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -177,8 +177,9 @@  discard block
 block discarded – undo
177 177
 	protected function _construct_tips() {
178 178
 		foreach ( $this->_qtipsa as $qt ) {
179 179
 			//make sure we have what we need.
180
-			if ( !isset( $qt['content_id'] ) || !isset( $qt['target'] ) || !isset( $qt['content'] ) )
181
-				throw new EE_Error( sprintf( __('There is something wrong with the _qtipsa property setup for the %s qtip config class.  The dump of the current array index is: %s.<br /><br />Please check that it is setup correctly.', 'event_espresso'), get_class($this), var_export($qt, true) ) );
180
+			if ( !isset( $qt['content_id'] ) || !isset( $qt['target'] ) || !isset( $qt['content'] ) ) {
181
+							throw new EE_Error( sprintf( __('There is something wrong with the _qtipsa property setup for the %s qtip config class.  The dump of the current array index is: %s.<br /><br />Please check that it is setup correctly.', 'event_espresso'), get_class($this), var_export($qt, true) ) );
182
+			}
182 183
 
183 184
 			//make sure the options include defaults and just override via set config.
184 185
 			$options_override = isset( $qt['options'] ) ? (array) $qt['options'] : array();
@@ -266,8 +267,9 @@  discard block
 block discarded – undo
266 267
 
267 268
 	public function __construct( $setup_array ) {
268 269
 		foreach ( $setup_array as $prop => $value ) {
269
-			if ( EEH_Class_Tools::has_property( $this, $prop ) )
270
-				$this->{$prop} = $value;
270
+			if ( EEH_Class_Tools::has_property( $this, $prop ) ) {
271
+							$this->{$prop} = $value;
272
+			}
271 273
 		}
272 274
 	}
273 275
 }
274 276
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 				'event' => 'mouseleave', //similar as what you do for show.event.
143 143
 				'target' => false, //Options jQuery::#selector. which html element will trigger hide event. When false, the element the .qtip() method was called upon is used.
144 144
 				'delay' => 0, //set time in milliseconds for delaying the hide of the tooltip
145
-				'inactive' => false,  //if integer, time in millisecons in which the tooltip should be hidden if remains inactive (not interacted with)
145
+				'inactive' => false, //if integer, time in millisecons in which the tooltip should be hidden if remains inactive (not interacted with)
146 146
 				'fixed' => false, //when set to true, the tooltip will not hide if moused over.
147 147
 				'leave' => 'window', //specify whether the tooltip will hide when leaving the window it's conained within.
148 148
 				'distance' => false, //if integer, distance in pixels that the tooltip hides when the mouse is moved from the point it triggered the tooltip.
@@ -175,21 +175,21 @@  discard block
 block discarded – undo
175 175
 	 * @return void
176 176
 	 */
177 177
 	protected function _construct_tips() {
178
-		foreach ( $this->_qtipsa as $qt ) {
178
+		foreach ($this->_qtipsa as $qt) {
179 179
 			//make sure we have what we need.
180
-			if ( !isset( $qt['content_id'] ) || !isset( $qt['target'] ) || !isset( $qt['content'] ) )
181
-				throw new EE_Error( sprintf( __('There is something wrong with the _qtipsa property setup for the %s qtip config class.  The dump of the current array index is: %s.<br /><br />Please check that it is setup correctly.', 'event_espresso'), get_class($this), var_export($qt, true) ) );
180
+			if ( ! isset($qt['content_id']) || ! isset($qt['target']) || ! isset($qt['content']))
181
+				throw new EE_Error(sprintf(__('There is something wrong with the _qtipsa property setup for the %s qtip config class.  The dump of the current array index is: %s.<br /><br />Please check that it is setup correctly.', 'event_espresso'), get_class($this), var_export($qt, true)));
182 182
 
183 183
 			//make sure the options include defaults and just override via set config.
184
-			$options_override = isset( $qt['options'] ) ? (array) $qt['options'] : array();
185
-			$options = array_merge( $this->_default_options, $options_override );
184
+			$options_override = isset($qt['options']) ? (array) $qt['options'] : array();
185
+			$options = array_merge($this->_default_options, $options_override);
186 186
 			$setup = array(
187 187
 				'content_id' => $qt['content_id'],
188 188
 				'options' => $options,
189 189
 				'target' => $qt['target'],
190 190
 				'content' => $qt['content']
191 191
 				);
192
-			$this->_qtips[] = new EE_Qtip( $setup );
192
+			$this->_qtips[] = new EE_Qtip($setup);
193 193
 		}
194 194
 	}
195 195
 
@@ -264,9 +264,9 @@  discard block
 block discarded – undo
264 264
 	public $target;
265 265
 	public $content;
266 266
 
267
-	public function __construct( $setup_array ) {
268
-		foreach ( $setup_array as $prop => $value ) {
269
-			if ( EEH_Class_Tools::has_property( $this, $prop ) )
267
+	public function __construct($setup_array) {
268
+		foreach ($setup_array as $prop => $value) {
269
+			if (EEH_Class_Tools::has_property($this, $prop))
270 270
 				$this->{$prop} = $value;
271 271
 		}
272 272
 	}
Please login to merge, or discard this patch.
core/db_models/strategies/EE_Default_Where_Conditions.strategy.php 2 patches
Spacing   +22 added lines, -22 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,7 +15,7 @@  discard block
 block discarded – undo
15 15
  * @since		 	    4.6.0
16 16
  *
17 17
  */
18
-class EE_Default_Where_Conditions{
18
+class EE_Default_Where_Conditions {
19 19
 
20 20
 	/**
21 21
 	 * This const can be used in EE_Default_Where_Conditions values, and at the time of querying it will be
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 * onto any field names
49 49
 	 * @param array $custom_where_conditions
50 50
 	 */
51
-	public function __construct( $custom_where_conditions = array() ) {
51
+	public function __construct($custom_where_conditions = array()) {
52 52
 		$this->_where_conditions_provided = $custom_where_conditions;
53 53
 	}
54 54
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 * for querying of the model.
60 60
 	 * @param EEM_Base $model
61 61
 	 */
62
-	function _finalize_construct(EEM_Base $model){
62
+	function _finalize_construct(EEM_Base $model) {
63 63
 		$this->_model = $model;
64 64
 	}
65 65
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 	 * @param string $model_relation_chain
81 81
 	 * @return array like what's expected in EEM_Base::get_all()'s $query_params[0]
82 82
 	 */
83
-	function get_default_where_conditions( $model_relation_chain = '' ){
84
-		return $this->prepare_where_conditions_for_querying( array_merge( $this->_get_default_where_conditions(), $this->get_where_conditions_provided() ), $model_relation_chain );
83
+	function get_default_where_conditions($model_relation_chain = '') {
84
+		return $this->prepare_where_conditions_for_querying(array_merge($this->_get_default_where_conditions(), $this->get_where_conditions_provided()), $model_relation_chain);
85 85
 	}
86 86
 
87 87
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 * Adding model relation chains is handled by the public method get_default_where_conditions
92 92
 	 * @return array
93 93
 	 */
94
-	protected function _get_default_where_conditions(){
94
+	protected function _get_default_where_conditions() {
95 95
 		return array();
96 96
 	}
97 97
 
@@ -105,36 +105,36 @@  discard block
 block discarded – undo
105 105
 	 * @return array
106 106
 	 * @throws \EE_Error
107 107
 	 */
108
-	public function prepare_where_conditions_for_querying( $where_conditions, $model_relation_chain ) {
108
+	public function prepare_where_conditions_for_querying($where_conditions, $model_relation_chain) {
109 109
 		$where_conditions_with_model_relation_chain_prefixes = array();
110
-		if ( ! is_array( $where_conditions ) ) {
110
+		if ( ! is_array($where_conditions)) {
111 111
 			$where_conditions = array();
112 112
 		}
113
-		foreach ( $where_conditions as $key => $value ) {
113
+		foreach ($where_conditions as $key => $value) {
114 114
 			if (
115
-				in_array( $key, array( 'OR', 'AND', 'NOT' ) )
116
-				|| strpos( $key, 'OR*' ) !== false
117
-				|| strpos( $key, 'AND*' ) !== false
118
-				|| strpos( $key, 'NOT*' ) !== false
115
+				in_array($key, array('OR', 'AND', 'NOT'))
116
+				|| strpos($key, 'OR*') !== false
117
+				|| strpos($key, 'AND*') !== false
118
+				|| strpos($key, 'NOT*') !== false
119 119
 			) {
120
-				$where_conditions_with_model_relation_chain_prefixes[ $key ] = $this->prepare_where_conditions_for_querying(
120
+				$where_conditions_with_model_relation_chain_prefixes[$key] = $this->prepare_where_conditions_for_querying(
121 121
 					$value,
122 122
 					$model_relation_chain
123 123
 				);
124 124
 			} else {
125 125
 				if (
126 126
 					$model_relation_chain != ''
127
-					&& $model_relation_chain[ strlen( $model_relation_chain ) - 1 ] != '.'
127
+					&& $model_relation_chain[strlen($model_relation_chain) - 1] != '.'
128 128
 				) {
129
-					$model_relation_chain = $model_relation_chain . ".";
129
+					$model_relation_chain = $model_relation_chain.".";
130 130
 				}
131 131
 				//check for the current user id place holder, and if present change it
132
-				if ( $value === self::current_user_placeholder ) {
132
+				if ($value === self::current_user_placeholder) {
133 133
 					$value = get_current_user_id();
134 134
 				}
135 135
 				//check for user field placeholder
136
-				if ( $key == self::user_field_name_placeholder ) {
137
-					if ( ! $this->_model->wp_user_field_name() ) {
136
+				if ($key == self::user_field_name_placeholder) {
137
+					if ( ! $this->_model->wp_user_field_name()) {
138 138
 						throw new EE_Error(
139 139
 							sprintf(
140 140
 								__(
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 					}
148 148
 					$key = $this->_model->wp_user_field_name();
149 149
 				}
150
-				$where_conditions_with_model_relation_chain_prefixes[ $model_relation_chain . $key ] = $value;
150
+				$where_conditions_with_model_relation_chain_prefixes[$model_relation_chain.$key] = $value;
151 151
 			}
152 152
 		}
153 153
 		return $where_conditions_with_model_relation_chain_prefixes;
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 to be used for getting default where conditions for EEM_Base children.
10 10
  * Should be initialized and set on construction of model
11 11
  *
Please login to merge, or discard this patch.
core/libraries/messages/EE_Message_Generated_From_Token.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
 	 *                                                This is then used to populate the properties in here.
37 37
 	 * @param   EE_Message_Resource_Manager $message_resource_manager
38 38
 	 */
39
-	public function __construct( $token, $sending_messenger_slug = 'html', EE_Message_Resource_Manager $message_resource_manager ) {
39
+	public function __construct($token, $sending_messenger_slug = 'html', EE_Message_Resource_Manager $message_resource_manager) {
40 40
 		$this->token = $token;
41
-		$this->_sending_messenger = $this->_set_sending_messenger( $sending_messenger_slug, $message_resource_manager );
41
+		$this->_sending_messenger = $this->_set_sending_messenger($sending_messenger_slug, $message_resource_manager);
42 42
 		$this->_message = $this->_generate_message();
43 43
 		//set params for parent from the message object
44 44
 		parent::__construct(
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 		$sending_messenger_slug,
62 62
 		EE_Message_Resource_Manager $message_resource_manager
63 63
 	) {
64
-		$sending_messenger = $message_resource_manager->get_active_messenger( $sending_messenger_slug );
64
+		$sending_messenger = $message_resource_manager->get_active_messenger($sending_messenger_slug);
65 65
 		return $sending_messenger instanceof EE_messenger ? $sending_messenger : $sending_messenger_slug;
66 66
 	}
67 67
 
@@ -83,27 +83,27 @@  discard block
 block discarded – undo
83 83
 	 * @return EE_Message
84 84
 	 * @throws \EE_Error
85 85
 	 */
86
-	protected function _generate_message( $properties = array() ) {
86
+	protected function _generate_message($properties = array()) {
87 87
 		// a message was generated immediately but the parent class will call this again
88
-		if ( $this->_message instanceof EE_Message ) {
88
+		if ($this->_message instanceof EE_Message) {
89 89
 			return $this->_message;
90 90
 		}
91
-		$message = EEM_Message::instance()->get_one_by_token( $this->token );
92
-		if ( ! $message instanceof EE_Message ) {
91
+		$message = EEM_Message::instance()->get_one_by_token($this->token);
92
+		if ( ! $message instanceof EE_Message) {
93 93
 			throw new EE_Error(
94 94
 				sprintf(
95
-					__( 'Unable to retrieve generated message from DB using given token: "%1$s"', 'event_espresso' ),
95
+					__('Unable to retrieve generated message from DB using given token: "%1$s"', 'event_espresso'),
96 96
 					$this->token
97 97
 				)
98 98
 			);
99 99
 		}
100
-		$message->set_STS_ID( EEM_Message::status_idle );
100
+		$message->set_STS_ID(EEM_Message::status_idle);
101 101
 
102
-		if ( ! $this->_sending_messenger instanceof EE_messenger ) {
103
-			$message->set_STS_ID( EEM_Message::status_failed );
102
+		if ( ! $this->_sending_messenger instanceof EE_messenger) {
103
+			$message->set_STS_ID(EEM_Message::status_failed);
104 104
 			$message->set_error_message(
105 105
 				sprintf(
106
-					__( 'Unable to send message because the "%1$s" messenger is not active or not installed', 'event_espresso' ),
106
+					__('Unable to send message because the "%1$s" messenger is not active or not installed', 'event_espresso'),
107 107
 					$this->_sending_messenger
108 108
 				)
109 109
 			);
Please login to merge, or discard this patch.
core/libraries/messages/EE_Message_To_Generate.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
 	public function __construct(
106 106
 		$messenger_name,
107 107
 		$message_type_name,
108
-		$data 	 = array(),
108
+		$data = array(),
109 109
 		$context = '',
110 110
 		$preview = false,
111 111
 		$status  = EEM_Message::status_incomplete
112 112
 	) {
113
-		$this->_messenger_name 		= $messenger_name;
114
-		$this->_message_type_name 	= $message_type_name;
115
-		$this->_data 				= is_array( $data ) ? $data : array( $data );
113
+		$this->_messenger_name = $messenger_name;
114
+		$this->_message_type_name = $message_type_name;
115
+		$this->_data = is_array($data) ? $data : array($data);
116 116
 		$this->_context 			= $context;
117 117
 		$this->_preview 			= $preview;
118 118
 		$this->_status 				= $status;
@@ -170,8 +170,8 @@  discard block
 block discarded – undo
170 170
 	/**
171 171
 	 * @param boolean $preview
172 172
 	 */
173
-	public function set_preview( $preview ) {
174
-		$this->_preview = filter_var( $preview, FILTER_VALIDATE_BOOLEAN );
173
+	public function set_preview($preview) {
174
+		$this->_preview = filter_var($preview, FILTER_VALIDATE_BOOLEAN);
175 175
 	}
176 176
 
177 177
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 	 * @param array $properties
203 203
 	 * @return string
204 204
 	 */
205
-	protected function _generate_message( $properties = array() ) {
205
+	protected function _generate_message($properties = array()) {
206 206
 		$message = EE_Message_Factory::create(
207 207
 			array_merge(
208 208
 				array(
@@ -216,12 +216,12 @@  discard block
 block discarded – undo
216 216
 		);
217 217
 		// validate the message, and if it's good, set some properties
218 218
 		try {
219
-			$message->is_valid_for_sending_or_generation( true );
219
+			$message->is_valid_for_sending_or_generation(true);
220 220
 			$this->_valid = true;
221 221
 			$this->_messenger = $message->messenger_object();
222 222
 			$this->_message_type = $message->message_type_object();
223 223
 			$this->_send_now = $message->send_now();
224
-		} catch ( Exception $e ) {
224
+		} catch (Exception $e) {
225 225
 			$this->_valid = false;
226 226
 			$this->_error_msg[] = $e->getMessage();
227 227
 		}
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	 */
238 238
 	public function get_EE_Message() {
239 239
 		// already set ?
240
-		if ( $this->_message instanceof EE_Message ) {
240
+		if ($this->_message instanceof EE_Message) {
241 241
 			return $this->_message;
242 242
 		}
243 243
 		// no? then let's create one
@@ -255,15 +255,15 @@  discard block
 block discarded – undo
255 255
 	 * @param   bool    $preview    Used to indicate that the preview data handler is to be returned.
256 256
 	 * @return  string
257 257
 	 */
258
-	public function get_data_handler_class_name( $preview = false ) {
259
-		if ( $this->_data_handler_class_name === '' && $this->valid() ) {
260
-			$ref = $preview ? 'Preview' : $this->_message_type->get_data_handler( $this->_data );
258
+	public function get_data_handler_class_name($preview = false) {
259
+		if ($this->_data_handler_class_name === '' && $this->valid()) {
260
+			$ref = $preview ? 'Preview' : $this->_message_type->get_data_handler($this->_data);
261 261
 			//make sure internal data is updated.
262 262
 			$this->_data = $this->_message_type->get_data();
263 263
 
264 264
 			//verify
265
-			$this->_data_handler_class_name = EE_Message_To_Generate::verify_and_retrieve_class_name_for_data_handler_reference( $ref );
266
-			if ( $this->_data_handler_class_name === '' ) {
265
+			$this->_data_handler_class_name = EE_Message_To_Generate::verify_and_retrieve_class_name_for_data_handler_reference($ref);
266
+			if ($this->_data_handler_class_name === '') {
267 267
 				$this->_valid = false;
268 268
 			}
269 269
 		}
@@ -279,9 +279,9 @@  discard block
 block discarded – undo
279 279
 	 * @param string $data_handler_reference
280 280
 	 * @return string
281 281
 	 */
282
-	public static function verify_and_retrieve_class_name_for_data_handler_reference( $data_handler_reference ) {
283
-		$class_name = 'EE_Messages_' . $data_handler_reference . '_incoming_data';
284
-		if ( ! class_exists( $class_name ) ) {
282
+	public static function verify_and_retrieve_class_name_for_data_handler_reference($data_handler_reference) {
283
+		$class_name = 'EE_Messages_'.$data_handler_reference.'_incoming_data';
284
+		if ( ! class_exists($class_name)) {
285 285
 			EE_Error::add_error(
286 286
 				sprintf(
287 287
 					__(
Please login to merge, or discard this patch.
core/libraries/messages/EE_Message_Type_Collection_Loader.lib.php 1 patch
Spacing   +19 added lines, -19 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
 
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 	 *
32 32
 	 * @param EE_Message_Type_Collection $message_types
33 33
 	 */
34
-	public function __construct( EE_Message_Type_Collection $message_types ) {
35
-		$this->set_message_type_collection( $message_types );
34
+	public function __construct(EE_Message_Type_Collection $message_types) {
35
+		$this->set_message_type_collection($message_types);
36 36
 	}
37 37
 
38 38
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	/**
50 50
 	 * @param mixed $message_types
51 51
 	 */
52
-	public function set_message_type_collection( EE_Message_Type_Collection $message_types ) {
52
+	public function set_message_type_collection(EE_Message_Type_Collection $message_types) {
53 53
 		$this->_message_type_collection = $message_types;
54 54
 	}
55 55
 
@@ -62,41 +62,41 @@  discard block
 block discarded – undo
62 62
 	 * @param  string $folder
63 63
 	 * @throws \EE_Error
64 64
 	 */
65
-	public function load_message_types_from_folder( $folder = '' ) {
65
+	public function load_message_types_from_folder($folder = '') {
66 66
 		//make sure autoloaders are set (fail-safe)
67 67
 		EED_Messages::set_autoloaders();
68
-		$folder = ! empty( $folder ) ? $folder : EE_LIBRARIES . 'messages' . DS . 'message_type';
69
-		$folder .= $folder[ strlen( $folder ) - 1 ] != DS ? DS : '';
68
+		$folder = ! empty($folder) ? $folder : EE_LIBRARIES.'messages'.DS.'message_type';
69
+		$folder .= $folder[strlen($folder) - 1] != DS ? DS : '';
70 70
 		// get all the files in that folder that end in ".class.php
71 71
 		$filepaths = apply_filters(
72 72
 			'FHEE__EE_messages__get_installed__messagetype_files',
73
-			glob( $folder . '*.class.php' )
73
+			glob($folder.'*.class.php')
74 74
 		);
75
-		if ( empty( $filepaths ) ) {
75
+		if (empty($filepaths)) {
76 76
 			return;
77 77
 		}
78
-		foreach ( (array) $filepaths as $file_path ) {
78
+		foreach ((array) $filepaths as $file_path) {
79 79
 			// extract filename from path
80
-			$file_path = basename( $file_path );
80
+			$file_path = basename($file_path);
81 81
 			// now remove any file extensions
82
-			$message_type_class_name = substr( $file_path, 0, strpos( $file_path, '.' ) );
82
+			$message_type_class_name = substr($file_path, 0, strpos($file_path, '.'));
83 83
 
84 84
 			//if this class name doesn't represent a message type class, then we just skip.
85
-			if ( strpos( strtolower( $message_type_class_name ), 'message_type' ) === false ) {
85
+			if (strpos(strtolower($message_type_class_name), 'message_type') === false) {
86 86
 				continue;
87 87
 			}
88 88
 
89
-			if ( ! class_exists( $message_type_class_name ) ) {
89
+			if ( ! class_exists($message_type_class_name)) {
90 90
 				throw new EE_Error(
91 91
 					sprintf(
92
-						__( 'The "%1$s" message type class can\'t be loaded from %2$s. Likely there is a typo in the class name or the file name.', 'event_espresso' ),
92
+						__('The "%1$s" message type class can\'t be loaded from %2$s. Likely there is a typo in the class name or the file name.', 'event_espresso'),
93 93
 						$message_type_class_name,
94 94
 						$file_path
95 95
 					)
96 96
 				);
97 97
 			}
98 98
 
99
-			$this->_load_message_type( new $message_type_class_name );
99
+			$this->_load_message_type(new $message_type_class_name);
100 100
 		}
101 101
 	}
102 102
 
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 	 * @param EE_message_type $message_type
107 107
 	 * @return bool
108 108
 	 */
109
-	protected function _load_message_type( EE_message_type $message_type ) {
110
-		if ( $this->message_type_collection()->has_by_name( $message_type->name ) ) {
109
+	protected function _load_message_type(EE_message_type $message_type) {
110
+		if ($this->message_type_collection()->has_by_name($message_type->name)) {
111 111
 			return true;
112 112
 		}
113 113
 		return $this->message_type_collection()->add(
Please login to merge, or discard this patch.
core/libraries/messages/EE_Messages_Base.lib.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
 	 * @access protected
185 185
 	 * @param string $messenger
186 186
 	 */
187
-	protected function _set_existing_admin_settings( $messenger = '' ) {
187
+	protected function _set_existing_admin_settings($messenger = '') {
188 188
 		/** @var EE_Message_Resource_Manager $Message_Resource_Manager */
189
-		$Message_Resource_Manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' );
189
+		$Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager');
190 190
 		$active_messengers = $Message_Resource_Manager->get_active_messengers_option();
191 191
 		$settings_to_use = $active_messengers;
192 192
 
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
 		 * This determines what will be used for the getting the settings.
195 195
 		 */
196 196
 		if (
197
-			! empty( $messenger )
198
-			&& $Message_Resource_Manager->is_message_type_active_for_messenger( $messenger, $this->name )
197
+			! empty($messenger)
198
+			&& $Message_Resource_Manager->is_message_type_active_for_messenger($messenger, $this->name)
199 199
 		) {
200
-			$settings_to_use = $active_messengers[ $messenger ]['settings'][ $messenger . '-message_types' ];
200
+			$settings_to_use = $active_messengers[$messenger]['settings'][$messenger.'-message_types'];
201 201
 		}
202 202
 
203
-		$this->_existing_admin_settings = isset( $settings_to_use[ $this->name ]['settings'] )
204
-			? $settings_to_use[ $this->name ]['settings']
203
+		$this->_existing_admin_settings = isset($settings_to_use[$this->name]['settings'])
204
+			? $settings_to_use[$this->name]['settings']
205 205
 			: null;
206 206
 	}
207 207
 
@@ -218,12 +218,12 @@  discard block
 block discarded – undo
218 218
 	 * @param string $messenger
219 219
 	 * @return array          settings
220 220
 	 */
221
-	public function get_existing_admin_settings( $messenger = '' ) {
221
+	public function get_existing_admin_settings($messenger = '') {
222 222
 		// if admin_settings property empty lets try setting it.
223
-		if ( method_exists($this, '_set_existing_admin_settings') && empty( $this->_existing_admin_settings ) ) {
224
-			$this->_set_existing_admin_settings( $messenger );
223
+		if (method_exists($this, '_set_existing_admin_settings') && empty($this->_existing_admin_settings)) {
224
+			$this->_set_existing_admin_settings($messenger);
225 225
 		}
226
-		return property_exists( $this, '_existing_admin_settings' )
226
+		return property_exists($this, '_existing_admin_settings')
227 227
 			? $this->_existing_admin_settings
228 228
 			: null;
229 229
 	}
@@ -239,12 +239,12 @@  discard block
 block discarded – undo
239 239
 	 */
240 240
 	public function get_valid_shortcodes() {
241 241
 		$valid_shortcodes = apply_filters(
242
-			'FHEE__' . get_class( $this ) . '__get_valid_shortcodes',
242
+			'FHEE__'.get_class($this).'__get_valid_shortcodes',
243 243
 			$this->_valid_shortcodes,
244 244
 			$this
245 245
 		);
246 246
 		//The below filter applies to ALL messengers and message types so use with care!
247
-		$valid_shortcodes = apply_filters( 'FHEE__EE_Messages_Base__get_valid_shortcodes', $valid_shortcodes, $this );
247
+		$valid_shortcodes = apply_filters('FHEE__EE_Messages_Base__get_valid_shortcodes', $valid_shortcodes, $this);
248 248
 		return $valid_shortcodes;
249 249
 	}
250 250
 
@@ -278,23 +278,23 @@  discard block
 block discarded – undo
278 278
 	 * @access protected
279 279
 	 * @return string $content for page.
280 280
 	 */
281
-	protected function _get_admin_page_content( $page, $action, $extra, $actives ) {
281
+	protected function _get_admin_page_content($page, $action, $extra, $actives) {
282 282
 		//we can also further refine the context by action (if present).
283
-		if ( !empty($action) ) {
284
-			$page = $page . '_' . $action;
283
+		if ( ! empty($action)) {
284
+			$page = $page.'_'.$action;
285 285
 		}
286 286
 
287
-		if ( !isset( $this->admin_registered_pages[$page]) ){
287
+		if ( ! isset($this->admin_registered_pages[$page])) {
288 288
 			// todo: a place to throw an exception?
289 289
 			// We need to indicate there is no registered page so this function is not being called correctly.
290 290
 			return false;
291 291
 		}
292 292
 		//k made it here so let's call the method
293 293
 		$content = call_user_func_array(
294
-			array( $this, '_get_admin_content_' . $page ),
295
-			array( $actives, $extra )
294
+			array($this, '_get_admin_content_'.$page),
295
+			array($actives, $extra)
296 296
 		);
297
-		if ( $content === false ) {
297
+		if ($content === false) {
298 298
 			// todo this needs to be an exception once we've got exceptions in place.
299 299
 			return false;
300 300
 		}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * EE_Messages_Base class
Please login to merge, or discard this patch.
core/libraries/messages/EE_Messages_Template_Pack_Collection.lib.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('No direct script access allowed');
4 4
 
5 5
 
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 		$this->interface = 'EE_Messages_Template_Pack';
18 18
 	}
19 19
 
20
-	public function get_by_name( $template_pack_name ) {
20
+	public function get_by_name($template_pack_name) {
21 21
 		$this->rewind();
22
-		while ( $this->valid() ) {
23
-			if ( $this->current()->dbref == $template_pack_name ) {
22
+		while ($this->valid()) {
23
+			if ($this->current()->dbref == $template_pack_name) {
24 24
 				return $this->current();
25 25
 			}
26 26
 			$this->next();
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION'))
2
+if (!defined('EVENT_ESPRESSO_VERSION')) {
3 3
 	exit('No direct script access allowed');
4
+}
4 5
 
5 6
 
6 7
 /**
Please login to merge, or discard this patch.
core/libraries/messages/EE_Messenger_Collection_Loader.lib.php 1 patch
Spacing   +22 added lines, -22 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
 
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 	 *
33 33
 	 * @param EE_Messenger_Collection $messengers
34 34
 	 */
35
-	public function __construct( EE_Messenger_Collection $messengers ) {
36
-		$this->set_messenger_collection( $messengers );
35
+	public function __construct(EE_Messenger_Collection $messengers) {
36
+		$this->set_messenger_collection($messengers);
37 37
 	}
38 38
 
39 39
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	/**
51 51
 	 * @param mixed $messengers
52 52
 	 */
53
-	public function set_messenger_collection( EE_Messenger_Collection $messengers ) {
53
+	public function set_messenger_collection(EE_Messenger_Collection $messengers) {
54 54
 		$this->_messenger_collection = $messengers;
55 55
 	}
56 56
 
@@ -63,41 +63,41 @@  discard block
 block discarded – undo
63 63
 	 * @param  string $folder
64 64
 	 * @throws \EE_Error
65 65
 	 */
66
-	public function load_messengers_from_folder( $folder = '' ) {
66
+	public function load_messengers_from_folder($folder = '') {
67 67
 		//make sure autoloaders are set (fail-safe)
68 68
 		EED_Messages::set_autoloaders();
69
-		$folder = ! empty( $folder ) ? $folder : EE_LIBRARIES . 'messages' . DS . 'messenger';
70
-		$folder .= $folder[ strlen( $folder ) - 1 ] != DS ? DS : '';
69
+		$folder = ! empty($folder) ? $folder : EE_LIBRARIES.'messages'.DS.'messenger';
70
+		$folder .= $folder[strlen($folder) - 1] != DS ? DS : '';
71 71
 		// get all the files in that folder that end in ".class.php
72 72
 		$filepaths = apply_filters(
73 73
 			'FHEE__EE_messages__get_installed__messenger_files',
74
-			glob( $folder . '*.class.php' )
74
+			glob($folder.'*.class.php')
75 75
 		);
76
-		if ( empty( $filepaths ) ) {
76
+		if (empty($filepaths)) {
77 77
 			return;
78 78
 		}
79
-		foreach ( (array) $filepaths as $file_path ) {
79
+		foreach ((array) $filepaths as $file_path) {
80 80
 			// extract filename from path
81
-			$file_path = basename( $file_path );
81
+			$file_path = basename($file_path);
82 82
 			// now remove any file extensions
83
-			$messenger_class_name = substr( $file_path, 0, strpos( $file_path, '.' ) );
83
+			$messenger_class_name = substr($file_path, 0, strpos($file_path, '.'));
84 84
 
85 85
 			//first check to see if the class name represents an actual messenger class.
86
-			if ( strpos( strtolower( $messenger_class_name ), 'messenger' ) === false ) {
86
+			if (strpos(strtolower($messenger_class_name), 'messenger') === false) {
87 87
 				continue;
88 88
 			}
89 89
 
90
-			if ( ! class_exists( $messenger_class_name ) ) {
90
+			if ( ! class_exists($messenger_class_name)) {
91 91
 				throw new EE_Error(
92 92
 					sprintf(
93
-						__( 'The "%1$s" messenger class can\'t be loaded from %2$s.  Likely there is a typo in the class name or the file name.', 'event_espresso' ),
93
+						__('The "%1$s" messenger class can\'t be loaded from %2$s.  Likely there is a typo in the class name or the file name.', 'event_espresso'),
94 94
 						$messenger_class_name,
95 95
 						$file_path
96 96
 					)
97 97
 				);
98 98
 			}
99 99
 
100
-			$this->_load_messenger( new $messenger_class_name() );
100
+			$this->_load_messenger(new $messenger_class_name());
101 101
 		}
102 102
 	}
103 103
 
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
 		EED_Messages::set_autoloaders();
114 114
 		$active_messengers = apply_filters(
115 115
 			'FHEE__EEH_MSG_Template__get_active_messengers_in_db',
116
-			get_option( 'ee_active_messengers', array() )
116
+			get_option('ee_active_messengers', array())
117 117
 		);
118
-		foreach ( (array) $active_messengers as $active_messenger_classname => $active_messenger ) {
119
-			$this->_load_messenger( $active_messenger );
118
+		foreach ((array) $active_messengers as $active_messenger_classname => $active_messenger) {
119
+			$this->_load_messenger($active_messenger);
120 120
 		}
121 121
 	}
122 122
 
@@ -128,8 +128,8 @@  discard block
 block discarded – undo
128 128
 	 * @param \EE_messenger $messenger
129 129
 	 * @return bool
130 130
 	 */
131
-	protected function _load_messenger( EE_messenger $messenger ) {
132
-		if ( $this->messenger_collection()->has_by_name( $messenger->name ) ) {
131
+	protected function _load_messenger(EE_messenger $messenger) {
132
+		if ($this->messenger_collection()->has_by_name($messenger->name)) {
133 133
 			return true;
134 134
 		}
135 135
 		return $this->messenger_collection()->add(
Please login to merge, or discard this patch.