Completed
Branch BUG-9804-double-click-spco-sub... (c2cac1)
by
unknown
43:17 queued 31:43
created
strategies/validation/EE_Float_Validation_Strategy.strategy.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	/**
26 26
 	 *
27 27
 	 * @param $normalized_value
28
-	 * @return bool
28
+	 * @return boolean|null
29 29
 	 */
30 30
 	function validate($normalized_value) {
31 31
 		//errors should have been detected by the normalization strategy
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,16 +8,16 @@  discard block
 block discarded – undo
8 8
  * @since 				4.6
9 9
  *
10 10
  */
11
-class EE_Float_Validation_Strategy extends EE_Validation_Strategy_Base{
11
+class EE_Float_Validation_Strategy extends EE_Validation_Strategy_Base {
12 12
 
13 13
 	/**
14 14
 	 * @param null $validation_error_message
15 15
 	 */
16
-	public function __construct( $validation_error_message = NULL ) {
17
-		if( ! $validation_error_message ){
16
+	public function __construct($validation_error_message = NULL) {
17
+		if ( ! $validation_error_message) {
18 18
 			$validation_error_message = sprintf(__("Only numeric characters, commas, periods, and spaces, please!", "event_espresso"));
19 19
 		}
20
-		parent::__construct( $validation_error_message );
20
+		parent::__construct($validation_error_message);
21 21
 	}
22 22
 
23 23
 
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
 	/**
37 37
 	 * @return array
38 38
 	 */
39
-	function get_jquery_validation_rule_array(){
40
-		return array('number'=>true, 'messages' => array( 'number' => $this->get_validation_error_message() ) );
39
+	function get_jquery_validation_rule_array() {
40
+		return array('number'=>true, 'messages' => array('number' => $this->get_validation_error_message()));
41 41
 	}
42 42
 }
43 43
 
Please login to merge, or discard this patch.
strategies/validation/EE_Many_Valued_Validation_Strategy.strategy.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 	/**
28 28
 	 * Applies all teh individual item validation strategies on each item in the array
29 29
 	 * @param array $normalized_value
30
-	 * @return boolean
30
+	 * @return boolean|null
31 31
 	 */
32 32
 	function validate($normalized_value) {
33 33
 		if( is_array($normalized_value)){
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
  * @since 				4.6
12 12
  *
13 13
  */
14
-class EE_Many_Valued_Validation_Strategy extends EE_Validation_Strategy_Base{
14
+class EE_Many_Valued_Validation_Strategy extends EE_Validation_Strategy_Base {
15 15
 	protected $_individual_item_validation_strategies = array();
16 16
 	/**
17 17
 	 *
18 18
 	 * @param EE_Validation_Strategy_Base[] $individual_item_validation_strategies (or a single EE_Validation_Strategy_Base)
19 19
 	 */
20 20
 	public function __construct($individual_item_validation_strategies) {
21
-		if( ! is_array($individual_item_validation_strategies)){
21
+		if ( ! is_array($individual_item_validation_strategies)) {
22 22
 			$individual_item_validation_strategies = array($individual_item_validation_strategies);
23 23
 		}
24 24
 		$this->_individual_item_validation_strategies = $individual_item_validation_strategies;
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 	 * @return boolean
31 31
 	 */
32 32
 	function validate($normalized_value) {
33
-		if( is_array($normalized_value)){
33
+		if (is_array($normalized_value)) {
34 34
 			$items_to_validate = $normalized_value;
35
-		}else{
35
+		} else {
36 36
 			$items_to_validate = array($normalized_value);
37 37
 		}
38
-		foreach($items_to_validate as $individual_item){
39
-			foreach($this->_individual_item_validation_strategies as $validation_strategy){
40
-				if ( $validation_strategy instanceof EE_Validation_Strategy_Base ) {
38
+		foreach ($items_to_validate as $individual_item) {
39
+			foreach ($this->_individual_item_validation_strategies as $validation_strategy) {
40
+				if ($validation_strategy instanceof EE_Validation_Strategy_Base) {
41 41
 					$validation_strategy->validate($individual_item);
42 42
 				}
43 43
 			}
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	function _construct_finalize(\EE_Form_Input_Base $form_input) {
52 52
 		parent::_construct_finalize($form_input);
53
-		foreach($this->_individual_item_validation_strategies as $item_validation_strategy){
54
-			if ( $item_validation_strategy instanceof EE_Validation_Strategy_Base ) {
53
+		foreach ($this->_individual_item_validation_strategies as $item_validation_strategy) {
54
+			if ($item_validation_strategy instanceof EE_Validation_Strategy_Base) {
55 55
 				$item_validation_strategy->_construct_finalize($form_input);
56 56
 			}
57 57
 		}
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 	function validate($normalized_value) {
33 33
 		if( is_array($normalized_value)){
34 34
 			$items_to_validate = $normalized_value;
35
-		}else{
35
+		} else{
36 36
 			$items_to_validate = array($normalized_value);
37 37
 		}
38 38
 		foreach($items_to_validate as $individual_item){
Please login to merge, or discard this patch.
form_sections/strategies/validation/EE_URL_Validation_Strategy.strategy.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 	 * just checks the field isn't blank
27 27
 	 *
28 28
 	 * @param $normalized_value
29
-	 * @return bool
29
+	 * @return boolean|null
30 30
 	 * @throws \EE_Validation_Error
31 31
 	 */
32 32
 	function validate($normalized_value) {
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,16 +8,16 @@  discard block
 block discarded – undo
8 8
  * @since 				4.6
9 9
  *
10 10
  */
11
-class EE_URL_Validation_Strategy extends EE_Validation_Strategy_Base{
11
+class EE_URL_Validation_Strategy extends EE_Validation_Strategy_Base {
12 12
 
13 13
 	/**
14 14
 	 * @param null $validation_error_message
15 15
 	 */
16
-	public function __construct( $validation_error_message = NULL ) {
17
-		if( ! $validation_error_message ){
16
+	public function __construct($validation_error_message = NULL) {
17
+		if ( ! $validation_error_message) {
18 18
 			$validation_error_message = __("Please enter a valid URL. Eg https://eventespresso.com", "event_espresso");
19 19
 		}
20
-		parent::__construct( $validation_error_message );
20
+		parent::__construct($validation_error_message);
21 21
 	}
22 22
 
23 23
 
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 	 * @throws \EE_Validation_Error
31 31
 	 */
32 32
 	function validate($normalized_value) {
33
-		if( $normalized_value ){
34
-			if (filter_var($normalized_value, FILTER_VALIDATE_URL) === false){
35
-				throw new EE_Validation_Error( $this->get_validation_error_message(), 'invalid_url');
36
-			}else{
37
-				if( ! EEH_URL::remote_file_exists(
33
+		if ($normalized_value) {
34
+			if (filter_var($normalized_value, FILTER_VALIDATE_URL) === false) {
35
+				throw new EE_Validation_Error($this->get_validation_error_message(), 'invalid_url');
36
+			} else {
37
+				if ( ! EEH_URL::remote_file_exists(
38 38
 						$normalized_value,
39 39
 						array(
40 40
 							'sslverify' => false, 
41
-							'limit_response_size' => 4095,//we don't really care for a full response, but we do want headers at least. Lets just ask for a one block
42
-						))){
41
+							'limit_response_size' => 4095, //we don't really care for a full response, but we do want headers at least. Lets just ask for a one block
42
+						))) {
43 43
 					throw new EE_Validation_Error(sprintf(__("That URL seems to be broken. Please enter a valid URL", "event_espresso")));
44 44
 				}
45 45
 			}
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 	/**
52 52
 	 * @return array
53 53
 	 */
54
-	function get_jquery_validation_rule_array(){
55
-		return array( 'validUrl'=>true, 'messages' => array( 'validUrl' => $this->get_validation_error_message() ) );
54
+	function get_jquery_validation_rule_array() {
55
+		return array('validUrl'=>true, 'messages' => array('validUrl' => $this->get_validation_error_message()));
56 56
 	}
57 57
 }
58 58
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 		if( $normalized_value ){
34 34
 			if (filter_var($normalized_value, FILTER_VALIDATE_URL) === false){
35 35
 				throw new EE_Validation_Error( $this->get_validation_error_message(), 'invalid_url');
36
-			}else{
36
+			} else{
37 37
 				if( ! EEH_URL::remote_file_exists(
38 38
 						$normalized_value,
39 39
 						array(
Please login to merge, or discard this patch.
line_item_display/EE_Admin_Table_Line_Item_Display_Strategy.strategy.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 * This is used to output a single
48 48
 	 * @param EE_Line_Item $line_item
49 49
 	 * @param array        $options
50
-	 * @return mixed
50
+	 * @return string
51 51
 	 */
52 52
 	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
53 53
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 *
164 164
 	 * @param EE_Line_Item $line_item
165 165
 	 * @param array        $options
166
-	 * @return mixed
166
+	 * @return string
167 167
 	 */
168 168
 	protected function _item_row( EE_Line_Item $line_item, $options = array() ) {
169 169
 		$line_item_related_object = $line_item->get_object();
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 	 *
230 230
 	 * @param EE_Line_Item $line_item
231 231
 	 * @param array        $options
232
-	 * @return mixed
232
+	 * @return string
233 233
 	 */
234 234
 	protected function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
235 235
 		//for now we're not showing sub-items
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 	 *
244 244
 	 * @param EE_Line_Item $line_item
245 245
 	 * @param array        $options
246
-	 * @return mixed
246
+	 * @return string
247 247
 	 */
248 248
 	protected function _tax_row( EE_Line_Item $line_item, $options = array() ) {
249 249
 		// start of row
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	 * @param EE_Line_Item $line_item
267 267
 	 * @param string       $text
268 268
 	 * @param array        $options
269
-	 * @return mixed
269
+	 * @return string
270 270
 	 */
271 271
 	protected function _sub_total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
272 272
 		//currently not showing subtotal row
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 	 *
281 281
 	 * @param EE_Line_Item $line_item
282 282
 	 * @param array        $options
283
-	 * @return mixed
283
+	 * @return string
284 284
 	 */
285 285
 	protected function _total_row( EE_Line_Item $line_item, $options = array() ) {
286 286
 		// start of row
Please login to merge, or discard this patch.
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @param array        $options
50 50
 	 * @return mixed
51 51
 	 */
52
-	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
52
+	public function display_line_item(EE_Line_Item $line_item, $options = array()) {
53 53
 
54 54
 		$html = '';
55 55
 		// set some default options and merge with incoming
@@ -60,40 +60,40 @@  discard block
 block discarded – undo
60 60
 			'taxes_tr_css_class' => 'admin-primary-mbox-taxes-tr',
61 61
 			'total_tr_css_class' => 'admin-primary-mbox-total-tr'
62 62
 		);
63
-		$options = array_merge( $default_options, (array)$options );
63
+		$options = array_merge($default_options, (array) $options);
64 64
 
65
-		switch( $line_item->type() ) {
65
+		switch ($line_item->type()) {
66 66
 
67 67
 			case EEM_Line_Item::type_line_item:
68 68
 				// item row
69
-				$html .= $this->_item_row( $line_item, $options );
69
+				$html .= $this->_item_row($line_item, $options);
70 70
 				break;
71 71
 
72 72
 			case EEM_Line_Item::type_sub_line_item:
73
-				$html .= $this->_sub_item_row( $line_item, $options );
73
+				$html .= $this->_sub_item_row($line_item, $options);
74 74
 				break;
75 75
 
76 76
 			case EEM_Line_Item::type_sub_total:
77 77
 				//loop through children
78 78
 				$child_line_items = $line_item->children();
79 79
 				//loop through children
80
-				foreach ( $child_line_items as $child_line_item ) {
80
+				foreach ($child_line_items as $child_line_item) {
81 81
 					//recursively feed children back into this method
82
-					$html .= $this->display_line_item( $child_line_item, $options );
82
+					$html .= $this->display_line_item($child_line_item, $options);
83 83
 				}
84
-				$html .= $this->_sub_total_row( $line_item, $options );
84
+				$html .= $this->_sub_total_row($line_item, $options);
85 85
 				break;
86 86
 
87 87
 			case EEM_Line_Item::type_tax:
88
-				if ( $this->_show_taxes ) {
89
-					$this->_taxes_html .= $this->_tax_row( $line_item, $options );
88
+				if ($this->_show_taxes) {
89
+					$this->_taxes_html .= $this->_tax_row($line_item, $options);
90 90
 				}
91 91
 				break;
92 92
 
93 93
 			case EEM_Line_Item::type_tax_sub_total:
94
-				foreach( $line_item->children() as $child_line_item ) {
95
-					if ( $child_line_item->type() == EEM_Line_Item::type_tax ) {
96
-						$this->display_line_item( $child_line_item, $options );
94
+				foreach ($line_item->children() as $child_line_item) {
95
+					if ($child_line_item->type() == EEM_Line_Item::type_tax) {
96
+						$this->display_line_item($child_line_item, $options);
97 97
 					}
98 98
 				}
99 99
 				break;
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
 				$children = $line_item->children();
106 106
 
107 107
 				// loop thru all non-tax child line items
108
-				foreach( $children as $child_line_item ) {
109
-						$html .= $this->display_line_item( $child_line_item, $options );
108
+				foreach ($children as $child_line_item) {
109
+						$html .= $this->display_line_item($child_line_item, $options);
110 110
 				}
111 111
 
112 112
 				$html .= $this->_taxes_html;
113
-				$html .= $this->_total_row( $line_item, $options );
114
-				if ( $options['use_table_wrapper'] ) {
115
-					$html = $this->_table_header( $options ) . $html . $this->_table_footer( $options );
113
+				$html .= $this->_total_row($line_item, $options);
114
+				if ($options['use_table_wrapper']) {
115
+					$html = $this->_table_header($options).$html.$this->_table_footer($options);
116 116
 				}
117 117
 				break;
118 118
 
@@ -129,15 +129,15 @@  discard block
 block discarded – undo
129 129
 	 * @param array $options
130 130
 	 * @return string
131 131
 	 */
132
-	protected function _table_header( $options ) {
133
-		$html = EEH_HTML::table( '','', $options['table_css_class'] );
132
+	protected function _table_header($options) {
133
+		$html = EEH_HTML::table('', '', $options['table_css_class']);
134 134
 		$html .= EEH_HTML::thead();
135 135
 		$html .= EEH_HTML::tr();
136
-		$html .= EEH_HTML::th( __( 'Name', 'event_espresso' ), '', 'jst-left' );
137
-		$html .= EEH_HTML::th( __( 'Type', 'event_espresso'), '', 'jst-left' );
138
-		$html .= EEH_HTML::th( __( 'Amount', 'event_espresso' ), '', 'jst-cntr' );
139
-		$html .= EEH_HTML::th( __( 'Qty', 'event_espresso' ), '', 'jst-cntr' );
140
-		$html .= EEH_HTML::th( __( 'Line Total', 'event_espresso'), '', 'jst-cntr' );
136
+		$html .= EEH_HTML::th(__('Name', 'event_espresso'), '', 'jst-left');
137
+		$html .= EEH_HTML::th(__('Type', 'event_espresso'), '', 'jst-left');
138
+		$html .= EEH_HTML::th(__('Amount', 'event_espresso'), '', 'jst-cntr');
139
+		$html .= EEH_HTML::th(__('Qty', 'event_espresso'), '', 'jst-cntr');
140
+		$html .= EEH_HTML::th(__('Line Total', 'event_espresso'), '', 'jst-cntr');
141 141
 		$html .= EEH_HTML::tbody();
142 142
 		return $html;
143 143
 	}
@@ -149,8 +149,8 @@  discard block
 block discarded – undo
149 149
 	 * @param array $options array of options for the table.
150 150
 	 * @return string
151 151
 	 */
152
-	protected function _table_footer( $options ) {
153
-		return EEH_HTML::tbodyx() .  EEH_HTML::tablex();
152
+	protected function _table_footer($options) {
153
+		return EEH_HTML::tbodyx().EEH_HTML::tablex();
154 154
 	}
155 155
 
156 156
 
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
 	 * @param array        $options
163 163
 	 * @return mixed
164 164
 	 */
165
-	protected function _item_row( EE_Line_Item $line_item, $options = array() ) {
165
+	protected function _item_row(EE_Line_Item $line_item, $options = array()) {
166 166
 		$line_item_related_object = $line_item->get_object();
167 167
 		$parent_line_item_related_object = $line_item->parent() instanceof EE_Line_Item ? $line_item->parent()->get_object() : null;
168 168
 		// start of row
169 169
 		$row_class = $options['odd'] ? 'item odd' : 'item';
170
-		$html = EEH_HTML::tr( '', '', $row_class );
170
+		$html = EEH_HTML::tr('', '', $row_class);
171 171
 
172 172
 
173 173
 		//Name Column
@@ -175,44 +175,44 @@  discard block
 block discarded – undo
175 175
 
176 176
 		//related object scope.
177 177
 		$parent_related_object_name = $parent_line_item_related_object instanceof EEI_Line_Item_Object ? $parent_line_item_related_object->name() : '';
178
-		$parent_related_object_name = empty( $parent_related_object_name ) && $line_item->parent() instanceof EE_Line_Item ? $line_item->parent()->name() : $parent_related_object_name;
178
+		$parent_related_object_name = empty($parent_related_object_name) && $line_item->parent() instanceof EE_Line_Item ? $line_item->parent()->name() : $parent_related_object_name;
179 179
 		$parent_related_object_link = $parent_line_item_related_object instanceof EEI_Admin_Links ? $parent_line_item_related_object->get_admin_details_link() : '';
180 180
 
181 181
 
182 182
 		$name_html = $line_item_related_object instanceof EEI_Line_Item_Object ? $line_item_related_object->name() : $line_item->name();
183
-		$name_html = $name_link ? '<a href="' . $name_link . '">' . $name_html . '</a>' : $name_html;
183
+		$name_html = $name_link ? '<a href="'.$name_link.'">'.$name_html.'</a>' : $name_html;
184 184
 		$name_html .= $line_item->is_taxable() ? ' *' : '';
185 185
 		//maybe preface with icon?
186
-		$name_html = $line_item_related_object instanceof EEI_Has_Icon ? $line_item_related_object->get_icon() . $name_html : $name_html;
187
-		$name_html = '<span class="ee-line-item-name linked">' . $name_html . '</span><br>';
188
-		$name_html .=  sprintf(
189
-			_x( '%1$sfor the %2$s: %3$s%4$s', 'eg. "for the Event: My Cool Event"', 'event_espresso'),
186
+		$name_html = $line_item_related_object instanceof EEI_Has_Icon ? $line_item_related_object->get_icon().$name_html : $name_html;
187
+		$name_html = '<span class="ee-line-item-name linked">'.$name_html.'</span><br>';
188
+		$name_html .= sprintf(
189
+			_x('%1$sfor the %2$s: %3$s%4$s', 'eg. "for the Event: My Cool Event"', 'event_espresso'),
190 190
 			'<span class="ee-line-item-related-parent-object">',
191
-			$line_item->parent() instanceof EE_Line_Item ? $line_item->parent()->OBJ_type() : __( 'Item:', 'event_espresso' ),
192
-			$parent_related_object_link ? '<a href="' . $parent_related_object_link . '">' . $parent_related_object_name . '</a>' : $parent_related_object_name,
191
+			$line_item->parent() instanceof EE_Line_Item ? $line_item->parent()->OBJ_type() : __('Item:', 'event_espresso'),
192
+			$parent_related_object_link ? '<a href="'.$parent_related_object_link.'">'.$parent_related_object_name.'</a>' : $parent_related_object_name,
193 193
 			'</span>'
194 194
 		);
195
-		$html .= EEH_HTML::td( $name_html, '', 'jst-left' );
195
+		$html .= EEH_HTML::td($name_html, '', 'jst-left');
196 196
 
197 197
 		//Type Column
198
-		$type_html = $line_item->OBJ_type() ? $line_item->OBJ_type() . '<br />' : '';
198
+		$type_html = $line_item->OBJ_type() ? $line_item->OBJ_type().'<br />' : '';
199 199
 		$code = $line_item_related_object instanceof EEI_Has_Code ? $line_item_related_object->code() : '';
200
-		$type_html .= ! empty( $code ) ? '<span class="ee-line-item-id">' . sprintf( __( 'Code: %s', 'event_espresso' ), $code ) . '</span>' : '';
201
-		$html .= EEH_HTML::td( $type_html, '', 'jst-left' );
200
+		$type_html .= ! empty($code) ? '<span class="ee-line-item-id">'.sprintf(__('Code: %s', 'event_espresso'), $code).'</span>' : '';
201
+		$html .= EEH_HTML::td($type_html, '', 'jst-left');
202 202
 
203 203
 
204 204
 		//Amount Column
205
-		if ( $line_item->is_percent() ) {
206
-			$html .= EEH_HTML::td( $line_item->percent() . '%', '', 'jst-rght' );
205
+		if ($line_item->is_percent()) {
206
+			$html .= EEH_HTML::td($line_item->percent().'%', '', 'jst-rght');
207 207
 		} else {
208
-			$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '', 'jst-rght' );
208
+			$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'jst-rght');
209 209
 		}
210 210
 
211 211
 		//QTY column
212
-		$html .= EEH_HTML::td( $line_item->quantity(), '', 'jst-rght' );
212
+		$html .= EEH_HTML::td($line_item->quantity(), '', 'jst-rght');
213 213
 
214 214
 		//total column
215
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '', 'jst-rght' );
215
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'jst-rght');
216 216
 
217 217
 		//finish things off and return
218 218
 		$html .= EEH_HTML::trx();
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	 * @param array        $options
229 229
 	 * @return mixed
230 230
 	 */
231
-	protected function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
231
+	protected function _sub_item_row(EE_Line_Item $line_item, $options = array()) {
232 232
 		//for now we're not showing sub-items
233 233
 		return '';
234 234
 	}
@@ -242,13 +242,13 @@  discard block
 block discarded – undo
242 242
 	 * @param array        $options
243 243
 	 * @return mixed
244 244
 	 */
245
-	protected function _tax_row( EE_Line_Item $line_item, $options = array() ) {
245
+	protected function _tax_row(EE_Line_Item $line_item, $options = array()) {
246 246
 		// start of row
247
-		$html = EEH_HTML::tr( '', 'admin-primary-mbox-taxes-tr' );
247
+		$html = EEH_HTML::tr('', 'admin-primary-mbox-taxes-tr');
248 248
 		// name th
249
-		$html .= EEH_HTML::th(  $line_item->name() . '(' . $line_item->get_pretty( 'LIN_percent' ) . '%)', '',  'jst-rght', '', ' colspan="4"' );
249
+		$html .= EEH_HTML::th($line_item->name().'('.$line_item->get_pretty('LIN_percent').'%)', '', 'jst-rght', '', ' colspan="4"');
250 250
 		// total th
251
-		$html .= EEH_HTML::th( EEH_Template::format_currency( $line_item->total(), false, false ), '', 'jst-rght' );
251
+		$html .= EEH_HTML::th(EEH_Template::format_currency($line_item->total(), false, false), '', 'jst-rght');
252 252
 		// end of row
253 253
 		$html .= EEH_HTML::trx();
254 254
 		return $html;
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 * @param array        $options
266 266
 	 * @return mixed
267 267
 	 */
268
-	protected function _sub_total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
268
+	protected function _sub_total_row(EE_Line_Item $line_item, $text = '', $options = array()) {
269 269
 		//currently not showing subtotal row
270 270
 		return '';
271 271
 	}
@@ -279,15 +279,15 @@  discard block
 block discarded – undo
279 279
 	 * @param array        $options
280 280
 	 * @return mixed
281 281
 	 */
282
-	protected function _total_row( EE_Line_Item $line_item, $options = array() ) {
282
+	protected function _total_row(EE_Line_Item $line_item, $options = array()) {
283 283
 		// start of row
284
-		$html = EEH_HTML::tr( '', '', 'admin-primary-mbox-total-tr' );
284
+		$html = EEH_HTML::tr('', '', 'admin-primary-mbox-total-tr');
285 285
 		// Total th label
286
-		$total_label = sprintf( __( 'Transaction Total %s', 'event_espresso' ),  '(' . EE_Registry::instance()->CFG->currency->code . ')' );
287
-		$html .= EEH_HTML::th( $total_label, '',  'jst-rght',  '',  ' colspan="4"' );
286
+		$total_label = sprintf(__('Transaction Total %s', 'event_espresso'), '('.EE_Registry::instance()->CFG->currency->code.')');
287
+		$html .= EEH_HTML::th($total_label, '', 'jst-rght', '', ' colspan="4"');
288 288
 		// total th
289 289
 
290
-		$html .= EEH_HTML::th( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'jst-rght' );
290
+		$html .= EEH_HTML::th(EEH_Template::format_currency($line_item->total(), false, false), '', 'jst-rght');
291 291
 		// end of row
292 292
 		$html .= EEH_HTML::trx();
293 293
 		return $html;
Please login to merge, or discard this patch.
line_item_display/EE_Receipt_Line_Item_Display_Strategy.strategy.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 	/**
32 32
 	 * @param EE_Line_Item $line_item
33 33
 	 * @param array        $options
34
-	 * @return mixed
34
+	 * @return string
35 35
 	 */
36 36
 	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
37 37
 
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@
 block discarded – undo
14 14
  * ------------------------------------------------------------------------
15 15
  */
16 16
  /**
17
- *
18
- * Class EE_Receipt_Line_Item_Display_Strategy
19
- *
20
- * Description
21
- *
22
- * @package         Event Espresso
23
- * @subpackage    core
24
- * @author				Brent Christensen
25
- * @since		 	   $VID:$
26
- *
27
- */
17
+  *
18
+  * Class EE_Receipt_Line_Item_Display_Strategy
19
+  *
20
+  * Description
21
+  *
22
+  * @package         Event Espresso
23
+  * @subpackage    core
24
+  * @author				Brent Christensen
25
+  * @since		 	   $VID:$
26
+  *
27
+  */
28 28
 
29 29
 class EE_Receipt_Line_Item_Display_Strategy  implements EEI_Line_Item_Display {
30 30
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @param array        $options
34 34
 	 * @return mixed
35 35
 	 */
36
-	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
36
+	public function display_line_item(EE_Line_Item $line_item, $options = array()) {
37 37
 
38 38
 		$html = '';
39 39
 		// set some default options and merge with incoming
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
 			'show_desc' => TRUE,
42 42
 			'odd' => FALSE
43 43
 		);
44
-		$options = array_merge( $default_options, (array)$options );
45
-		switch( $line_item->type() ) {
44
+		$options = array_merge($default_options, (array) $options);
45
+		switch ($line_item->type()) {
46 46
 
47 47
 			case EEM_Line_Item::type_total:
48 48
 				// loop thru children
49
-				foreach( $line_item->children() as $child_line_item ) {
49
+				foreach ($line_item->children() as $child_line_item) {
50 50
 					// recursively feed children back into this method
51 51
 //					$html .= $this->display_line_item( $child_line_item, $options );
52 52
 				}
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 			case EEM_Line_Item::type_sub_total:
59 59
 				// loop thru children
60
-				foreach( $line_item->children() as $child_line_item ) {
60
+				foreach ($line_item->children() as $child_line_item) {
61 61
 					// recursively feed children back into this method
62 62
 //					$html .= $this->display_line_item( $child_line_item, $options );
63 63
 				}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
 			case EEM_Line_Item::type_tax_sub_total:
69 69
 				// loop thru children
70
-				foreach( $line_item->children() as $child_line_item ) {
70
+				foreach ($line_item->children() as $child_line_item) {
71 71
 					// recursively feed children back into this method
72 72
 //					$html .= $this->display_line_item( $child_line_item, $options );
73 73
 				}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 				// item row
80 80
 //				$html .= $this->_item_row( $line_item, $options );
81 81
 				// got any kids?
82
-				foreach( $line_item->children() as $child_line_item ) {
82
+				foreach ($line_item->children() as $child_line_item) {
83 83
 //					$this->display_line_item( $child_line_item, $options );
84 84
 				}
85 85
 				break;
Please login to merge, or discard this patch.
core/libraries/messages/messenger/EE_Pdf_messenger.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@
 block discarded – undo
332 332
 
333 333
 
334 334
 	/**
335
-	 * @return string
335
+	 * @return boolean|null
336 336
 	 */
337 337
 	protected function _preview() { return $this->_send_message(); }
338 338
 
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
10 10
 	exit('NO direct script access allowed');
11 11
 
12 12
 /**
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  * @subpackage		messages
21 21
  * @author			Darren Ethier
22 22
  */
23
-class EE_Pdf_messenger extends EE_messenger  {
23
+class EE_Pdf_messenger extends EE_messenger {
24 24
 
25 25
 
26 26
 	/**
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 * @see abstract declaration in EE_messenger for details.
66 66
 	 */
67 67
 	protected function _set_admin_pages() {
68
-		$this->admin_registered_pages = array( 'events_edit' => false );
68
+		$this->admin_registered_pages = array('events_edit' => false);
69 69
 	}
70 70
 
71 71
 
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
 	protected function _set_validator_config() {
86 86
 		$this->_validator_config = array(
87 87
 			'subject' => array(
88
-				'shortcodes' => array('recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email','event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime')
88
+				'shortcodes' => array('recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email', 'event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime')
89 89
 				),
90 90
 			'content' => array(
91
-				'shortcodes' => array( 'recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email','event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime')
91
+				'shortcodes' => array('recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email', 'event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime')
92 92
 				),
93 93
 			'attendee_list' => array(
94 94
 				'shortcodes' => array('attendee', 'event_list', 'ticket_list'),
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 				'required' => array('[EVENT_LIST]')
100 100
 				),
101 101
 			'ticket_list' => array(
102
-				'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'recipient_details'),
102
+				'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'recipient_details'),
103 103
 				'required' => array('[TICKET_LIST]')
104 104
 				),
105 105
 			'datetime_list' => array(
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public  function enqueue_scripts_styles() {
121 121
 		parent::enqueue_scripts_styles();
122
-		do_action( 'AHEE__EE_Pdf_messenger__enqueue_scripts_styles');
122
+		do_action('AHEE__EE_Pdf_messenger__enqueue_scripts_styles');
123 123
 	}
124 124
 
125 125
 
@@ -245,18 +245,18 @@  discard block
 block discarded – undo
245 245
 	 */
246 246
 	protected function _send_message() {
247 247
 		$this->_template_args = array(
248
-			'page_title' => html_entity_decode( stripslashes( $this->_subject ), ENT_QUOTES, "UTF-8"),
249
-			'base_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation ),
250
-			'print_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation ),
251
-			'main_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation ),
252
-			'extra_css' => EE_LIBRARIES_URL . 'messages/defaults/default/variations/pdf_base_default.css',
253
-			'main_body' => apply_filters( 'FHEE__EE_Pdf_messenger___send_message__main_body', wpautop(stripslashes_deep( html_entity_decode($this->_content,  ENT_QUOTES,"UTF-8" ) )), $this->_content )
248
+			'page_title' => html_entity_decode(stripslashes($this->_subject), ENT_QUOTES, "UTF-8"),
249
+			'base_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation),
250
+			'print_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation),
251
+			'main_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation),
252
+			'extra_css' => EE_LIBRARIES_URL.'messages/defaults/default/variations/pdf_base_default.css',
253
+			'main_body' => apply_filters('FHEE__EE_Pdf_messenger___send_message__main_body', wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8"))), $this->_content)
254 254
 			);
255 255
 		$this->_deregister_wp_hooks();
256
-		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ) );
256
+		add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_styles'));
257 257
 		$content = $this->_get_main_template();
258 258
 //		die( $content );
259
-		$this->_do_pdf( $content );
259
+		$this->_do_pdf($content);
260 260
 		exit(0);
261 261
 	}
262 262
 
@@ -280,8 +280,8 @@  discard block
 block discarded – undo
280 280
 
281 281
 		//just add back in wp_enqueue_scripts and wp_print_footer_scripts cause that's all we want to load.
282 282
 		add_action('wp_head', 'wp_enqueue_scripts');
283
-		add_action( 'wp_footer', 'wp_print_footer_scripts' );
284
-		add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' );
283
+		add_action('wp_footer', 'wp_print_footer_scripts');
284
+		add_action('wp_print_footer_scripts', '_wp_footer_scripts');
285 285
 	}
286 286
 
287 287
 
@@ -294,11 +294,11 @@  discard block
 block discarded – undo
294 294
 	 * @param bool $preview
295 295
 	 * @return string
296 296
 	 */
297
-	protected function _get_main_template( $preview = FALSE ) {
298
-		$wrapper_template = $this->_tmp_pack->get_wrapper( 'html', 'main' );
297
+	protected function _get_main_template($preview = FALSE) {
298
+		$wrapper_template = $this->_tmp_pack->get_wrapper('html', 'main');
299 299
 		//add message type to template_args
300 300
 		$this->_template_args['message_type'] = $this->_incoming_message_type;
301
-		return EEH_Template::display_template( $wrapper_template, $this->_template_args, TRUE );
301
+		return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE);
302 302
 	}
303 303
 
304 304
 
@@ -311,21 +311,21 @@  discard block
 block discarded – undo
311 311
 	 *
312 312
 	 * @return void
313 313
 	 */
314
-	protected function _do_pdf( $content = '' ) {
315
-		$invoice_name = html_entity_decode( $this->_subject, ENT_QUOTES, "UTF-8");
314
+	protected function _do_pdf($content = '') {
315
+		$invoice_name = html_entity_decode($this->_subject, ENT_QUOTES, "UTF-8");
316 316
 
317 317
 		//only load dompdf if nobody else has yet...
318
-		if( ! defined('DOMPDF_DIR')){
318
+		if ( ! defined('DOMPDF_DIR')) {
319 319
 			define('DOMPDF_ENABLE_REMOTE', TRUE);
320 320
 			define('DOMPDF_ENABLE_JAVASCRIPT', FALSE);
321 321
 			define('DOMPDF_ENABLE_CSS_FLOAT', TRUE);
322
-			require_once(EE_THIRD_PARTY . 'dompdf/dompdf_config.inc.php');
322
+			require_once(EE_THIRD_PARTY.'dompdf/dompdf_config.inc.php');
323 323
 		}
324 324
 		$dompdf = new DOMPDF();
325 325
 		$dompdf->load_html($content);
326 326
 		$dompdf->render();
327 327
 		//forcing the browser to open a download dialog.
328
-		$dompdf->stream($invoice_name . ".pdf", array( 'Attachment' => TRUE ));
328
+		$dompdf->stream($invoice_name.".pdf", array('Attachment' => TRUE));
329 329
 	}
330 330
 
331 331
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
core/libraries/qtips/EE_Qtip_Config.lib.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@
 block discarded – undo
200 200
 	 * return the _qtips property contents
201 201
 	 *
202 202
 	 * @access public
203
-	 * @return EE_Qtip[]
203
+	 * @return EE_Qtip
204 204
 	 */
205 205
 	public function get_tips() {
206 206
 		return $this->_qtips;
Please login to merge, or discard this patch.
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/libraries/shortcodes/EE_Event_Shortcodes.lib.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -179,6 +179,7 @@
 block discarded – undo
179 179
 	/**
180 180
 	 * returns the link to the event
181 181
 	 * @param  boolean $full_link if TRUE (default) we return the html for the name of the event linked to the event.  Otherwise we just return the url of the event.
182
+	 * @param EE_Event $event
182 183
 	 * @return string
183 184
 	 */
184 185
 	private function _get_event_link( $event, $full_link = TRUE ) {
Please login to merge, or discard this patch.
Braces   +11 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  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 7
 /**
7 8
  * Event Espresso
@@ -85,8 +86,9 @@  discard block
 block discarded – undo
85 86
 
86 87
 
87 88
 		//If there is no event objecdt by now then get out.
88
-		if ( ! $this->_event instanceof EE_Event )
89
-			return '';
89
+		if ( ! $this->_event instanceof EE_Event ) {
90
+					return '';
91
+		}
90 92
 
91 93
 		switch ( $shortcode ) {
92 94
 
@@ -125,14 +127,16 @@  discard block
 block discarded – undo
125 127
 
126 128
 			case '[VIRTUAL_URL]' :
127 129
 				$venue = $this->_event->get_first_related('Venue');
128
-				if ( empty( $venue ) )
129
-					return '';
130
+				if ( empty( $venue ) ) {
131
+									return '';
132
+				}
130 133
 				return $venue->get('VNU_virtual_url');
131 134
 
132 135
 			case '[VIRTUAL_PHONE]' :
133 136
 				$venue = $this->_event->get_first_related('Venue');
134
-				if ( empty( $venue ) )
135
-					return '';
137
+				if ( empty( $venue ) ) {
138
+									return '';
139
+				}
136 140
 				return $venue->get('VNU_virtual_phone');
137 141
 				break;
138 142
 
Please login to merge, or discard this patch.
Spacing   +29 added lines, -29 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
 /**
@@ -55,33 +55,33 @@  discard block
 block discarded – undo
55 55
 			'[EVENT_NAME]' => __("This also can be used for the name of the event", 'event_espresso'),
56 56
 			'[EVENT_PHONE]' => __('The phone number for the event (usually an info number)', 'event_espresso'),
57 57
 			'[EVENT_DESCRIPTION]' => __('The description of the event', 'event_espresso'),
58
-			'[EVENT_EXCERPT]' => __( 'This gets parsed to the value for the excerpt field in the event or blank if there is no excerpt.', 'event_espresso' ),
58
+			'[EVENT_EXCERPT]' => __('This gets parsed to the value for the excerpt field in the event or blank if there is no excerpt.', 'event_espresso'),
59 59
 			'[EVENT_LINK]' => __('A link associated with the event', 'event_espresso'),
60 60
 			'[EVENT_URL]' => __('A link to the event set up on the host site.', 'event_espresso'),
61 61
 			'[VIRTUAL_URL]' => __('What was used for the "URL of Event" field in the Venue settings', 'event_espresso'),
62 62
 			'[VIRTUAL_PHONE]' => __('An alternate phone number for the event. Typically used as a "call-in" number', 'event_espresso'),
63 63
 			'[EVENT_IMAGE]' => __('This will parse to the Feature image for the event.', 'event_espresso'),
64 64
 			'[EVENT_TOTAL_AVAILABLE_SPACES_*]' => sprintf(
65
-				__( 'This will parse to the total available spaces for an event. Calculating total spaces is approximate because it is dependent on the complexity of limits on your event.  There are two methods of calculation (which can be indicated by the %1$smethod%2$s param on the shortcode).  %1$scurrent%2$s which will do a more accurate calculation of total available spaces based on current sales, and %1$sfull%2$s which will be the maximum total available spaces that is on the event in optimal conditions. The shortcode will default to current.', 'event_espresso' ),
65
+				__('This will parse to the total available spaces for an event. Calculating total spaces is approximate because it is dependent on the complexity of limits on your event.  There are two methods of calculation (which can be indicated by the %1$smethod%2$s param on the shortcode).  %1$scurrent%2$s which will do a more accurate calculation of total available spaces based on current sales, and %1$sfull%2$s which will be the maximum total available spaces that is on the event in optimal conditions. The shortcode will default to current.', 'event_espresso'),
66 66
 				'<code>',
67 67
 				'</code>'
68 68
 				),
69
-			'[EVENT_TOTAL_SPOTS_TAKEN]' => __( 'This shortcode will parse to the output the total approved registrations for this event', 'event_espresso' ),
69
+			'[EVENT_TOTAL_SPOTS_TAKEN]' => __('This shortcode will parse to the output the total approved registrations for this event', 'event_espresso'),
70 70
 			'[EVENT_FACEBOOK_URL]' => __('This will return the Facebook URL for the event if you have it set via custom field in your event, otherwise it will use the Facebook URL set in "Your Organization Settings". To set the facebook url in your event, add a custom field with the key as <code>event_facebook</code> and the value as your facebook url.', 'event_espresso'),
71 71
 			'[EVENT_TWITTER_URL]' => __('This will return the Twitter URL for the event if you have it set via custom field in your event, otherwise it will use the Twitter URL set in "Your Organization Settings". To set the facebook url in your event, add a custom field with the key as <code>event_twitter</code> and the value as your facebook url', 'event_espresso'),
72 72
 			'[EVENT_META_*]' => __('This is a special dynamic shortcode. After the "*", add the exact name for your custom field, if there is a value set for that custom field within the event then it will be output in place of this shortcode.', 'event_espresso'),
73
-			'[REGISTRATION_LIST_TABLE_FOR_EVENT_URL]' => __( 'This parses to the url for the registration list table filtered by registrations for this event.', 'event_espresso' ),
73
+			'[REGISTRATION_LIST_TABLE_FOR_EVENT_URL]' => __('This parses to the url for the registration list table filtered by registrations for this event.', 'event_espresso'),
74 74
 			);
75 75
 	}
76 76
 
77 77
 
78
-	protected function _parser( $shortcode ) {
78
+	protected function _parser($shortcode) {
79 79
 
80 80
 
81 81
 		$this->_event = $this->_data instanceof EE_Event ? $this->_data : null;
82 82
 
83 83
 		//if no event, then let's see if there is a reg_obj.  If there IS, then we'll try and grab the event from the reg_obj instead.
84
-		if ( empty( $this->_event ) ) {
84
+		if (empty($this->_event)) {
85 85
 			$aee = $this->_data instanceof EE_Messages_Addressee ? $this->_data : NULL;
86 86
 			$aee = $this->_extra_data instanceof EE_Messages_Addressee ? $this->_extra_data : $aee;
87 87
 
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 
91 91
 
92 92
 		//If there is no event objecdt by now then get out.
93
-		if ( ! $this->_event instanceof EE_Event )
93
+		if ( ! $this->_event instanceof EE_Event)
94 94
 			return '';
95 95
 
96
-		switch ( $shortcode ) {
96
+		switch ($shortcode) {
97 97
 
98 98
 			case '[EVENT_ID]' :
99 99
 				return $this->_event->ID();
@@ -126,41 +126,41 @@  discard block
 block discarded – undo
126 126
 
127 127
 			case '[VIRTUAL_URL]' :
128 128
 				$venue = $this->_event->get_first_related('Venue');
129
-				if ( empty( $venue ) )
129
+				if (empty($venue))
130 130
 					return '';
131 131
 				return $venue->get('VNU_virtual_url');
132 132
 
133 133
 			case '[VIRTUAL_PHONE]' :
134 134
 				$venue = $this->_event->get_first_related('Venue');
135
-				if ( empty( $venue ) )
135
+				if (empty($venue))
136 136
 					return '';
137 137
 				return $venue->get('VNU_virtual_phone');
138 138
 				break;
139 139
 
140 140
 			case '[EVENT_IMAGE]' :
141
-				$image = $this->_event->feature_image_url(array(600,300) );
141
+				$image = $this->_event->feature_image_url(array(600, 300));
142 142
 				// @todo: eventually we should make this an attribute shortcode so that em can send along what size they want returned.
143
-				return !empty( $image ) ? '<img src="' . $image . '" alt="' . sprintf( esc_attr__( '%s Feature Image', 'event_espresso'), $this->_event->get('EVT_name') ) . '" />' : '';
143
+				return ! empty($image) ? '<img src="'.$image.'" alt="'.sprintf(esc_attr__('%s Feature Image', 'event_espresso'), $this->_event->get('EVT_name')).'" />' : '';
144 144
 				break;
145 145
 
146 146
 			case '[EVENT_FACEBOOK_URL]' :
147
-				$facebook_url = $this->_event->get_post_meta('event_facebook', true );
148
-				return empty( $facebook_url ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'facebook' ) : $facebook_url;
147
+				$facebook_url = $this->_event->get_post_meta('event_facebook', true);
148
+				return empty($facebook_url) ? EE_Registry::instance()->CFG->organization->get_pretty('facebook') : $facebook_url;
149 149
 				break;
150 150
 
151 151
 			case '[EVENT_TWITTER_URL]' :
152 152
 				$twitter_url = $this->_event->get_post_meta('event_twitter', true);
153
-				return empty( $twitter_url ) ? EE_Registry::instance()->CFG->organization->get_pretty( 'twitter' ) : $twitter_url;
153
+				return empty($twitter_url) ? EE_Registry::instance()->CFG->organization->get_pretty('twitter') : $twitter_url;
154 154
 				break;
155 155
 
156 156
 			case '[EVENT_AUTHOR_EMAIL]' :
157 157
 				$author_id = $this->_event->get('EVT_wp_user');
158
-				$user_data = get_userdata( (int) $author_id );
158
+				$user_data = get_userdata((int) $author_id);
159 159
 				return $user_data->user_email;
160 160
 				break;
161 161
 
162 162
 			case '[EVENT_TOTAL_SPOTS_TAKEN]' :
163
-				return EEM_Registration::instance()->count( array( array( 'EVT_ID' => $this->_event->ID(), 'STS_ID' => EEM_Registration::status_id_approved ) ), 'REG_ID', true );
163
+				return EEM_Registration::instance()->count(array(array('EVT_ID' => $this->_event->ID(), 'STS_ID' => EEM_Registration::status_id_approved)), 'REG_ID', true);
164 164
 				break;
165 165
 
166 166
 			case '[REGISTRATION_LIST_TABLE_FOR_EVENT_URL]' :
@@ -170,26 +170,26 @@  discard block
 block discarded – undo
170 170
 						'page' => 'espresso_registrations',
171 171
 						'action' => 'default'
172 172
 					),
173
-					admin_url( 'admin.php' ),
173
+					admin_url('admin.php'),
174 174
 					true
175 175
 				);
176 176
 				break;
177 177
 		}
178 178
 
179
-		if ( strpos( $shortcode, '[EVENT_META_*' ) !== false ) {
180
-			$shortcode = str_replace( '[EVENT_META_*', '', $shortcode );
181
-			$shortcode = trim( str_replace( ']', '', $shortcode ) );
179
+		if (strpos($shortcode, '[EVENT_META_*') !== false) {
180
+			$shortcode = str_replace('[EVENT_META_*', '', $shortcode);
181
+			$shortcode = trim(str_replace(']', '', $shortcode));
182 182
 
183 183
 			//pull the meta value from the event post
184
-			$event_meta = $this->_event->get_post_meta( $shortcode, true );
184
+			$event_meta = $this->_event->get_post_meta($shortcode, true);
185 185
 
186
-			return !empty( $event_meta ) ? $this->_event->get_post_meta( $shortcode, true ) : '';
186
+			return ! empty($event_meta) ? $this->_event->get_post_meta($shortcode, true) : '';
187 187
 
188 188
 		}
189 189
 
190
-		if ( strpos( $shortcode, '[EVENT_TOTAL_AVAILABLE_SPACES_*' ) !== false ) {
191
-			$attrs = $this->_get_shortcode_attrs( $shortcode );
192
-			$method = empty( $attrs['method'] ) ? 'current' : $attrs['method'];
190
+		if (strpos($shortcode, '[EVENT_TOTAL_AVAILABLE_SPACES_*') !== false) {
191
+			$attrs = $this->_get_shortcode_attrs($shortcode);
192
+			$method = empty($attrs['method']) ? 'current' : $attrs['method'];
193 193
 			$method = $method === 'current';
194 194
 			$available = $this->_event->total_available_spaces($method);
195 195
 			return $available === EE_INF ? '&infin;' : $available;
@@ -205,10 +205,10 @@  discard block
 block discarded – undo
205 205
 	 * @param  boolean $full_link if TRUE (default) we return the html for the name of the event linked to the event.  Otherwise we just return the url of the event.
206 206
 	 * @return string
207 207
 	 */
208
-	private function _get_event_link( $event, $full_link = TRUE ) {
208
+	private function _get_event_link($event, $full_link = TRUE) {
209 209
 		$url = get_permalink($event->ID());
210 210
 
211
-		return $full_link ? '<a href="' . $url . '">' . $event->get('EVT_name') . '</a>' : $url;
211
+		return $full_link ? '<a href="'.$url.'">'.$event->get('EVT_name').'</a>' : $url;
212 212
 	}
213 213
 
214 214
 
Please login to merge, or discard this patch.
core/libraries/shortcodes/EE_Primary_Registration_List_Shortcodes.lib.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -109,6 +109,9 @@  discard block
 block discarded – undo
109 109
 	}
110 110
 
111 111
 
112
+	/**
113
+	 * @param EE_Registration $reg
114
+	 */
112 115
 	private function _get_tickets_from_event( EE_Event $event, $reg = NULL ) {
113 116
 		$evt_tkts = isset($this->_extra_data['data']->events) ? $this->_extra_data['data']->events[$event->ID()]['tkt_objs'] : array();
114 117
 
@@ -177,6 +180,9 @@  discard block
 block discarded – undo
177 180
 
178 181
 
179 182
 
183
+	/**
184
+	 * @param EE_Registration $reg
185
+	 */
180 186
 	private function _get_datetimes_from_event( EE_Event $event, $reg = NULL ) {
181 187
 		$evt_dtts = isset($this->_extra_data['data']->events) ? $this->_extra_data['data']->events[$event->ID()]['dtt_objs'] : array();
182 188
 
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 
44 44
 
45 45
 
46
-	protected function _parser( $shortcode ) {
47
-		switch ( $shortcode ) {
46
+	protected function _parser($shortcode) {
47
+		switch ($shortcode) {
48 48
 
49 49
 			case '[PRIMARY_REGISTRANT_TICKET_LIST]' :
50
-				return $this->_get_recipient_ticket_list( TRUE );
50
+				return $this->_get_recipient_ticket_list(TRUE);
51 51
 				break;
52 52
 
53 53
 			case '[PRIMARY_REGISTRANT_DATETIME_LIST]' :
54
-				return $this->_get_recipient_datetime_list( TRUE );
54
+				return $this->_get_recipient_datetime_list(TRUE);
55 55
 				break;
56 56
 		}
57 57
 		return '';
@@ -65,57 +65,57 @@  discard block
 block discarded – undo
65 65
 	 * @param  boolean $primary whether we're getting the primary registrant ticket_list.
66 66
 	 * @return string
67 67
 	 */
68
-	private function _get_recipient_ticket_list( $primary = FALSE ) {
68
+	private function _get_recipient_ticket_list($primary = FALSE) {
69 69
 		$this->_validate_list_requirements();
70 70
 
71
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
72
-			return $this->_get_recipient_ticket_list_parsed( $this->_data['data'], $primary );
71
+		if ($this->_data['data'] instanceof EE_Messages_Addressee)
72
+			return $this->_get_recipient_ticket_list_parsed($this->_data['data'], $primary);
73 73
 
74
-		else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee )
75
-			return $this->_get_recipient_ticket_list_parsed( $this->_extra_data['data'], $primary );
74
+		else if ($this->_extra_data['data'] instanceof EE_Messages_Addressee)
75
+			return $this->_get_recipient_ticket_list_parsed($this->_extra_data['data'], $primary);
76 76
 
77 77
 		else
78 78
 			return '';
79 79
 	}
80 80
 
81 81
 
82
-	private function _get_recipient_ticket_list_parsed( EE_Messages_Addressee $data, $primary = FALSE ) {
82
+	private function _get_recipient_ticket_list_parsed(EE_Messages_Addressee $data, $primary = FALSE) {
83 83
 		$registration = $primary ? $data->primary_reg_obj : $data->reg_obj;
84
-			if ( ! $registration instanceof EE_Registration ) return '';
84
+			if ( ! $registration instanceof EE_Registration) return '';
85 85
 		//setup valid shortcodes depending on what the status of the $this->_data property is
86
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
87
-			$valid_shortcodes = array('ticket', 'event_list', 'attendee_list','datetime_list', 'registration_details', 'attendee');
86
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
87
+			$valid_shortcodes = array('ticket', 'event_list', 'attendee_list', 'datetime_list', 'registration_details', 'attendee');
88 88
 			$template = $this->_data['template'];
89 89
 			$tkts = array($data->registrations[$registration->ID()]['tkt_obj']);
90 90
 			$data = $this->_data;
91
-		} elseif ( $this->_data['data'] instanceof EE_Event ) {
91
+		} elseif ($this->_data['data'] instanceof EE_Event) {
92 92
 			$valid_shortcodes = array('ticket', 'attendee_list', 'datetime_list', 'attendee');
93
-			$template = is_array($this->_data['template'] ) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
93
+			$template = is_array($this->_data['template']) && isset($this->_data['template']['ticket_list']) ? $this->_data['template']['ticket_list'] : $this->_extra_data['template']['ticket_list'];
94 94
 			//let's remove any existing [EVENT_LIST] shortcode from the ticket list template so that we don't get recursion.
95 95
 			$template = str_replace('[EVENT_LIST]', '', $template);
96 96
 			//data will be tickets for this event for this recipient.
97
-			$tkts = $this->_get_tickets_from_event( $this->_data['data'], $registration );
97
+			$tkts = $this->_get_tickets_from_event($this->_data['data'], $registration);
98 98
 			$data = $this->_extra_data;
99 99
 		} else {
100 100
 			return '';
101 101
 		}
102 102
 
103 103
 		$tktparsed = '';
104
-		foreach ( $tkts as $ticket ) {
105
-			$tktparsed .= $this->_shortcode_helper->parse_ticket_list_template( $template, $ticket, $valid_shortcodes, $data );
104
+		foreach ($tkts as $ticket) {
105
+			$tktparsed .= $this->_shortcode_helper->parse_ticket_list_template($template, $ticket, $valid_shortcodes, $data);
106 106
 		}
107 107
 		return $tktparsed;
108 108
 	}
109 109
 
110 110
 
111
-	private function _get_tickets_from_event( EE_Event $event, $reg = NULL ) {
111
+	private function _get_tickets_from_event(EE_Event $event, $reg = NULL) {
112 112
 		$evt_tkts = isset($this->_extra_data['data']->events) ? $this->_extra_data['data']->events[$event->ID()]['tkt_objs'] : array();
113 113
 
114
-		if ( $reg instanceof EE_Registration && $this->_extra_data['data'] instanceof EE_Messages_Addressee ) {
114
+		if ($reg instanceof EE_Registration && $this->_extra_data['data'] instanceof EE_Messages_Addressee) {
115 115
 			$adj_tkts = array();
116 116
 			//return only tickets for the given attendee
117
-			foreach ( $evt_tkts as $tkt ) {
118
-				if ( isset( $this->_extra_data['data']->registrations[$reg->ID()]['tkt_obj'] ) && $this->_extra_data['data']->registrations[$reg->ID()]['tkt_obj']->ID() == $tkt->ID() )
117
+			foreach ($evt_tkts as $tkt) {
118
+				if (isset($this->_extra_data['data']->registrations[$reg->ID()]['tkt_obj']) && $this->_extra_data['data']->registrations[$reg->ID()]['tkt_obj']->ID() == $tkt->ID())
119 119
 					$adj_tkts[] = $tkt;
120 120
 			}
121 121
 			$evt_tkts = $adj_tkts;
@@ -132,57 +132,57 @@  discard block
 block discarded – undo
132 132
 	 * @param  boolean $primary whether we're getting the primary registrant ticket_list.
133 133
 	 * @return string
134 134
 	 */
135
-	private function _get_recipient_datetime_list( $primary = FALSE ) {
135
+	private function _get_recipient_datetime_list($primary = FALSE) {
136 136
 		$this->_validate_list_requirements();
137 137
 
138
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
139
-			return $this->_get_recipient_datetime_list_parsed( $this->_data['data'], $primary );
138
+		if ($this->_data['data'] instanceof EE_Messages_Addressee)
139
+			return $this->_get_recipient_datetime_list_parsed($this->_data['data'], $primary);
140 140
 
141
-		else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee )
142
-			return $this->_get_recipient_datetime_list_parsed( $this->_extra_data['data'], $primary );
141
+		else if ($this->_extra_data['data'] instanceof EE_Messages_Addressee)
142
+			return $this->_get_recipient_datetime_list_parsed($this->_extra_data['data'], $primary);
143 143
 
144 144
 		else
145 145
 			return '';
146 146
 
147
-		return $this->_get_recipient_datetime_list_parsed( $this->_data['data'], $primary);
147
+		return $this->_get_recipient_datetime_list_parsed($this->_data['data'], $primary);
148 148
 	}
149 149
 
150 150
 
151
-	private function _get_recipient_datetime_list_parsed( EE_Messages_Addressee $data, $primary = FALSE ) {
151
+	private function _get_recipient_datetime_list_parsed(EE_Messages_Addressee $data, $primary = FALSE) {
152 152
 		$registration = $primary ? $data->primary_reg_obj : $data->reg_obj;
153
-		if ( ! $registration instanceof EE_Registration ) return '';
153
+		if ( ! $registration instanceof EE_Registration) return '';
154 154
 		//setup valid shortcodes depending on what the status of the $this->_data property is
155
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
155
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
156 156
 			$valid_shortcodes = array('datetime', 'attendee');
157 157
 			$template = $this->_data['template'];
158 158
 			$dtts = $data->registrations[$registration->ID()]['dtt_objs'];
159 159
 			$data = $this->_data;
160
-		} elseif ( $this->_data['data'] instanceof EE_Event ) {
160
+		} elseif ($this->_data['data'] instanceof EE_Event) {
161 161
 			$valid_shortcodes = array('datetime', 'attendee');
162
-			$template = is_array($this->_data['template'] ) && isset($this->_data['template']['datetime_list']) ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
163
-			$dtts = $this->_get_datetimes_from_event( $this->_data['data'], $registration );
162
+			$template = is_array($this->_data['template']) && isset($this->_data['template']['datetime_list']) ? $this->_data['template']['datetime_list'] : $this->_extra_data['template']['datetime_list'];
163
+			$dtts = $this->_get_datetimes_from_event($this->_data['data'], $registration);
164 164
 			$data = $this->_extra_data;
165 165
 		} else {
166 166
 			return '';
167 167
 		}
168 168
 
169 169
 		$dtt_parsed = '';
170
-		foreach ( $dtts as $datetime ) {
171
-			$dtt_parsed .= $this->_shortcode_helper->parse_datetime_list_template( $template, $datetime, $valid_shortcodes, $this->_extra_data );
170
+		foreach ($dtts as $datetime) {
171
+			$dtt_parsed .= $this->_shortcode_helper->parse_datetime_list_template($template, $datetime, $valid_shortcodes, $this->_extra_data);
172 172
 		}
173 173
 		return $dtt_parsed;
174 174
 	}
175 175
 
176 176
 
177 177
 
178
-	private function _get_datetimes_from_event( EE_Event $event, $reg = NULL ) {
178
+	private function _get_datetimes_from_event(EE_Event $event, $reg = NULL) {
179 179
 		$evt_dtts = isset($this->_extra_data['data']->events) ? $this->_extra_data['data']->events[$event->ID()]['dtt_objs'] : array();
180 180
 
181
-		if ( $reg instanceof EE_Registration && $this->_extra_data['data'] instanceof EE_Messages_Addressee ) {
181
+		if ($reg instanceof EE_Registration && $this->_extra_data['data'] instanceof EE_Messages_Addressee) {
182 182
 			$adj_dtts = array();
183 183
 			//return only dtts for the given attendee
184
-			foreach ( $evt_dtts as $dtt ) {
185
-				if ( isset( $this->_extra_data['data']->registrations[$reg->ID()]['dtt_objs'][$dtt->ID()] ) )
184
+			foreach ($evt_dtts as $dtt) {
185
+				if (isset($this->_extra_data['data']->registrations[$reg->ID()]['dtt_objs'][$dtt->ID()]))
186 186
 					$adj_dtts[] = $dtt;
187 187
 			}
188 188
 			$evt_dtts = $adj_dtts;
Please login to merge, or discard this patch.
Braces   +26 added lines, -22 removed lines patch added patch discarded remove patch
@@ -68,20 +68,21 @@  discard block
 block discarded – undo
68 68
 	private function _get_recipient_ticket_list( $primary = FALSE ) {
69 69
 		$this->_validate_list_requirements();
70 70
 
71
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
72
-			return $this->_get_recipient_ticket_list_parsed( $this->_data['data'], $primary );
73
-
74
-		else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee )
75
-			return $this->_get_recipient_ticket_list_parsed( $this->_extra_data['data'], $primary );
76
-
77
-		else
78
-			return '';
71
+		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
72
+					return $this->_get_recipient_ticket_list_parsed( $this->_data['data'], $primary );
73
+		} else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee ) {
74
+					return $this->_get_recipient_ticket_list_parsed( $this->_extra_data['data'], $primary );
75
+		} else {
76
+					return '';
77
+		}
79 78
 	}
80 79
 
81 80
 
82 81
 	private function _get_recipient_ticket_list_parsed( EE_Messages_Addressee $data, $primary = FALSE ) {
83 82
 		$registration = $primary ? $data->primary_reg_obj : $data->reg_obj;
84
-			if ( ! $registration instanceof EE_Registration ) return '';
83
+			if ( ! $registration instanceof EE_Registration ) {
84
+				return '';
85
+			}
85 86
 		//setup valid shortcodes depending on what the status of the $this->_data property is
86 87
 		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
87 88
 			$valid_shortcodes = array('ticket', 'event_list', 'attendee_list','datetime_list', 'registration_details', 'attendee');
@@ -115,8 +116,9 @@  discard block
 block discarded – undo
115 116
 			$adj_tkts = array();
116 117
 			//return only tickets for the given attendee
117 118
 			foreach ( $evt_tkts as $tkt ) {
118
-				if ( isset( $this->_extra_data['data']->registrations[$reg->ID()]['tkt_obj'] ) && $this->_extra_data['data']->registrations[$reg->ID()]['tkt_obj']->ID() == $tkt->ID() )
119
-					$adj_tkts[] = $tkt;
119
+				if ( isset( $this->_extra_data['data']->registrations[$reg->ID()]['tkt_obj'] ) && $this->_extra_data['data']->registrations[$reg->ID()]['tkt_obj']->ID() == $tkt->ID() ) {
120
+									$adj_tkts[] = $tkt;
121
+				}
120 122
 			}
121 123
 			$evt_tkts = $adj_tkts;
122 124
 		}
@@ -135,14 +137,13 @@  discard block
 block discarded – undo
135 137
 	private function _get_recipient_datetime_list( $primary = FALSE ) {
136 138
 		$this->_validate_list_requirements();
137 139
 
138
-		if ( $this->_data['data'] instanceof EE_Messages_Addressee )
139
-			return $this->_get_recipient_datetime_list_parsed( $this->_data['data'], $primary );
140
-
141
-		else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee )
142
-			return $this->_get_recipient_datetime_list_parsed( $this->_extra_data['data'], $primary );
143
-
144
-		else
145
-			return '';
140
+		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
141
+					return $this->_get_recipient_datetime_list_parsed( $this->_data['data'], $primary );
142
+		} else if ( $this->_extra_data['data'] instanceof EE_Messages_Addressee ) {
143
+					return $this->_get_recipient_datetime_list_parsed( $this->_extra_data['data'], $primary );
144
+		} else {
145
+					return '';
146
+		}
146 147
 
147 148
 		return $this->_get_recipient_datetime_list_parsed( $this->_data['data'], $primary);
148 149
 	}
@@ -150,7 +151,9 @@  discard block
 block discarded – undo
150 151
 
151 152
 	private function _get_recipient_datetime_list_parsed( EE_Messages_Addressee $data, $primary = FALSE ) {
152 153
 		$registration = $primary ? $data->primary_reg_obj : $data->reg_obj;
153
-		if ( ! $registration instanceof EE_Registration ) return '';
154
+		if ( ! $registration instanceof EE_Registration ) {
155
+			return '';
156
+		}
154 157
 		//setup valid shortcodes depending on what the status of the $this->_data property is
155 158
 		if ( $this->_data['data'] instanceof EE_Messages_Addressee ) {
156 159
 			$valid_shortcodes = array('datetime', 'attendee');
@@ -182,8 +185,9 @@  discard block
 block discarded – undo
182 185
 			$adj_dtts = array();
183 186
 			//return only dtts for the given attendee
184 187
 			foreach ( $evt_dtts as $dtt ) {
185
-				if ( isset( $this->_extra_data['data']->registrations[$reg->ID()]['dtt_objs'][$dtt->ID()] ) )
186
-					$adj_dtts[] = $dtt;
188
+				if ( isset( $this->_extra_data['data']->registrations[$reg->ID()]['dtt_objs'][$dtt->ID()] ) ) {
189
+									$adj_dtts[] = $dtt;
190
+				}
187 191
 			}
188 192
 			$evt_dtts = $adj_dtts;
189 193
 		}
Please login to merge, or discard this patch.