Completed
Branch FET-9643-checkin-system-docume... (5f5a9c)
by
unknown
200:04 queued 188:44
created
form_sections/strategies/validation/EE_Int_Validation_Strategy.strategy.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@  discard block
 block discarded – undo
6 6
  * @subpackage	Expression package is undefined on line 19, column 19 in Templates/Scripting/PHPClass.php.
7 7
  * @author				Mike Nelson
8 8
  */
9
-class EE_Int_Validation_Strategy extends EE_Validation_Strategy_Base{
9
+class EE_Int_Validation_Strategy extends EE_Validation_Strategy_Base {
10 10
 
11 11
 	/**
12 12
 	 * @param null $validation_error_message
13 13
 	 */
14
-	public function __construct( $validation_error_message = NULL ) {
15
-		if( ! $validation_error_message ){
14
+	public function __construct($validation_error_message = NULL) {
15
+		if ( ! $validation_error_message) {
16 16
 			$validation_error_message = __("Only digits are allowed.", "event_espresso");
17 17
 		}
18
-		parent::__construct( $validation_error_message );
18
+		parent::__construct($validation_error_message);
19 19
 	}
20 20
 
21 21
 
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
 	/**
33 33
 	 * @return array
34 34
 	 */
35
-	function get_jquery_validation_rule_array(){
36
-		return array('digits'=>true, 'messages' => array( 'digits' => $this->get_validation_error_message() ) );
35
+	function get_jquery_validation_rule_array() {
36
+		return array('digits'=>true, 'messages' => array('digits' => $this->get_validation_error_message()));
37 37
 	}
38 38
 }
39 39
 
Please login to merge, or discard this patch.
strategies/validation/EE_Min_Length_Validation_Strategy.strategy.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,32 +8,32 @@
 block discarded – undo
8 8
  * @subpackage	Expression package is undefined on line 19, column 19 in Templates/Scripting/PHPClass.php.
9 9
  * @author				Mike Nelson
10 10
  */
11
-class EE_Min_Length_Validation_Strategy extends EE_Validation_Strategy_Base{
11
+class EE_Min_Length_Validation_Strategy extends EE_Validation_Strategy_Base {
12 12
 
13 13
 	protected $_min_length;
14 14
 
15
-	public function __construct( $validation_error_message = NULL, $min_length = 0 ) {
15
+	public function __construct($validation_error_message = NULL, $min_length = 0) {
16 16
 		$this->_min_length = $min_length;
17
-		parent::__construct( $validation_error_message );
17
+		parent::__construct($validation_error_message);
18 18
 	}
19 19
 
20 20
 	/**
21 21
 	 * @param $normalized_value
22 22
 	 */
23 23
 	public function validate($normalized_value) {
24
-		if( $this->_min_length > 0 &&
24
+		if ($this->_min_length > 0 &&
25 25
 				$normalized_value &&
26
-				is_string( $normalized_value ) &&
27
-				strlen( $normalized_value ) < $this->_min_length){
28
-			throw new EE_Validation_Error( $this->get_validation_error_message(), 'minlength' );
26
+				is_string($normalized_value) &&
27
+				strlen($normalized_value) < $this->_min_length) {
28
+			throw new EE_Validation_Error($this->get_validation_error_message(), 'minlength');
29 29
 		}
30 30
 	}
31 31
 
32 32
 	/**
33 33
 	 * @return array
34 34
 	 */
35
-	function get_jquery_validation_rule_array(){
36
-		return array( 'minlength'=> $this->_min_length, 'messages' => array( 'minlength' => $this->get_validation_error_message() ) );
35
+	function get_jquery_validation_rule_array() {
36
+		return array('minlength'=> $this->_min_length, 'messages' => array('minlength' => $this->get_validation_error_message()));
37 37
 	}
38 38
 }
39 39
 
Please login to merge, or discard this patch.
strategies/validation/EE_Plaintext_Validation_Strategy.strategy.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,16 +10,16 @@  discard block
 block discarded – undo
10 10
  * @since 				4.6
11 11
  *
12 12
  */
13
-class EE_Plaintext_Validation_Strategy extends EE_Validation_Strategy_Base{
13
+class EE_Plaintext_Validation_Strategy extends EE_Validation_Strategy_Base {
14 14
 
15 15
 	/**
16 16
 	 * @param null $validation_error_message
17 17
 	 */
18
-	public function __construct( $validation_error_message = NULL ) {
19
-		if( ! $validation_error_message ){
20
-			$validation_error_message = __( "HTML tags are not permitted in this field", "event_espresso" );
18
+	public function __construct($validation_error_message = NULL) {
19
+		if ( ! $validation_error_message) {
20
+			$validation_error_message = __("HTML tags are not permitted in this field", "event_espresso");
21 21
 		}
22
-		parent::__construct( $validation_error_message );
22
+		parent::__construct($validation_error_message);
23 23
 	}
24 24
 
25 25
 	/**
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
 	 * @throws \EE_Validation_Error
28 28
 	 */
29 29
 	public function validate($normalized_value) {
30
-		$no_tags = wp_strip_all_tags( $normalized_value );
31
-		if( strlen( $no_tags ) < strlen( trim( $normalized_value ) ) ) {
32
-			throw new EE_Validation_Error( $this->get_validation_error_message(), 'no_html_tags' );
30
+		$no_tags = wp_strip_all_tags($normalized_value);
31
+		if (strlen($no_tags) < strlen(trim($normalized_value))) {
32
+			throw new EE_Validation_Error($this->get_validation_error_message(), 'no_html_tags');
33 33
 		}
34 34
 		parent::validate($normalized_value);
35 35
 	}
Please login to merge, or discard this patch.
strategies/validation/EE_Required_Validation_Strategy.strategy.php 2 patches
Spacing   +9 added lines, -9 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_Required_Validation_Strategy extends EE_Validation_Strategy_Base{
11
+class EE_Required_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 = __("This field is required.", "event_espresso");
19 19
 		}
20
-		parent::__construct( $validation_error_message );
20
+		parent::__construct($validation_error_message);
21 21
 	}
22 22
 
23 23
 
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 	 * @throws \EE_Validation_Error
31 31
 	 */
32 32
 	function validate($normalized_value) {
33
-		if( $normalized_value === '' || $normalized_value === NULL || $normalized_value === array()){
34
-			throw new EE_Validation_Error( $this->get_validation_error_message(), 'required');
35
-		}else{
33
+		if ($normalized_value === '' || $normalized_value === NULL || $normalized_value === array()) {
34
+			throw new EE_Validation_Error($this->get_validation_error_message(), 'required');
35
+		} else {
36 36
 			return true;
37 37
 		}
38 38
 	}
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 	/**
43 43
 	 * @return array
44 44
 	 */
45
-	function get_jquery_validation_rule_array(){
46
-		return array( 'required'=>true, 'messages' => array( 'required' => $this->get_validation_error_message() ) );
45
+	function get_jquery_validation_rule_array() {
46
+		return array('required'=>true, 'messages' => array('required' => $this->get_validation_error_message()));
47 47
 	}
48 48
 
49 49
 }
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( $normalized_value === '' || $normalized_value === NULL || $normalized_value === array()){
34 34
 			throw new EE_Validation_Error( $this->get_validation_error_message(), 'required');
35
-		}else{
35
+		} else{
36 36
 			return true;
37 37
 		}
38 38
 	}
Please login to merge, or discard this patch.
strategies/validation/EE_Text_Validation_Strategy.strategy.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 	function get_jquery_validation_rule_array(){
33 33
 		if( $this->_regex !== null ){
34 34
 			return array( 'regex'=> $this->regex_js(), 'messages' => array( 'regex' => $this->get_validation_error_message() ) );
35
-		}else{
35
+		} else{
36 36
 			return array();
37 37
 		}
38 38
 
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  * @subpackage	Expression package is undefined on line 19, column 19 in Templates/Scripting/PHPClass.php.
8 8
  * @author				Mike Nelson
9 9
  */
10
-class EE_Text_Validation_Strategy extends EE_Validation_Strategy_Base{
10
+class EE_Text_Validation_Strategy extends EE_Validation_Strategy_Base {
11 11
 
12 12
 	protected $_regex = null;
13 13
 	/**
@@ -15,18 +15,18 @@  discard block
 block discarded – undo
15 15
 	 * @param string $validation_error_message
16 16
 	 * @param string $regex a PHP regex; the javascript regex will be derived from this
17 17
 	 */
18
-	public function __construct( $validation_error_message = NULL, $regex = null ) {
18
+	public function __construct($validation_error_message = NULL, $regex = null) {
19 19
 		$this->_regex = $regex;
20
-		parent::__construct( $validation_error_message );
20
+		parent::__construct($validation_error_message);
21 21
 	}
22 22
 
23 23
 	/**
24 24
 	 * @param $normalized_value
25 25
 	 */
26 26
 	public function validate($normalized_value) {
27
-		if( $this->_regex && $normalized_value) {
28
-			if( ! preg_match( $this->_regex, $normalized_value ) ) {
29
-				throw new EE_Validation_Error( $this->get_validation_error_message(), 'regex' );
27
+		if ($this->_regex && $normalized_value) {
28
+			if ( ! preg_match($this->_regex, $normalized_value)) {
29
+				throw new EE_Validation_Error($this->get_validation_error_message(), 'regex');
30 30
 			}
31 31
 		}
32 32
 	}
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 	/**
35 35
 	 * @return array
36 36
 	 */
37
-	function get_jquery_validation_rule_array(){
38
-		if( $this->_regex !== null ){
39
-			return array( 'regex'=> $this->regex_js(), 'messages' => array( 'regex' => $this->get_validation_error_message() ) );
40
-		}else{
37
+	function get_jquery_validation_rule_array() {
38
+		if ($this->_regex !== null) {
39
+			return array('regex'=> $this->regex_js(), 'messages' => array('regex' => $this->get_validation_error_message()));
40
+		} else {
41 41
 			return array();
42 42
 		}
43 43
 
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 	function regex_js() {
52 52
 		//first character must be the delimiter
53 53
 		$delimeter = $this->_regex[0];
54
-		$last_occurence_of_delimieter = strrpos($this->_regex, $delimeter );
55
-		return substr( $this->_regex, 1, $last_occurence_of_delimieter - 1 );
54
+		$last_occurence_of_delimieter = strrpos($this->_regex, $delimeter);
55
+		return substr($this->_regex, 1, $last_occurence_of_delimieter - 1);
56 56
 	}
57 57
 }
58 58
 
Please login to merge, or discard this patch.
strategies/validation/EE_Validation_Strategy_Base.strategy.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @since 				4.6
9 9
  *
10 10
  */
11
-abstract class EE_Validation_Strategy_Base extends EE_Form_Input_Strategy_Base{
11
+abstract class EE_Validation_Strategy_Base extends EE_Form_Input_Strategy_Base {
12 12
 
13 13
 
14 14
 	protected $_validation_error_message = '';
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 	/**
19 19
 	 * @param null $validation_error_message
20 20
 	 */
21
-	public function __construct( $validation_error_message = NULL ) {
22
-		$this->_validation_error_message = $validation_error_message === NULL ? __( 'Input invalid', 'event_espresso' ) : $validation_error_message ;
21
+	public function __construct($validation_error_message = NULL) {
22
+		$this->_validation_error_message = $validation_error_message === NULL ? __('Input invalid', 'event_espresso') : $validation_error_message;
23 23
 		parent::__construct();
24 24
 	}
25 25
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 * @param mixed $normalized_value ready for validation. May very well be NULL (which, unless
35 35
 	 * this validation strategy is the 'required' validation strategy, most should be OK with a null, empty string, etc)
36 36
 	 */
37
-	function validate($normalized_value){
37
+	function validate($normalized_value) {
38 38
 		//by default, the validation strategy does no validation. this should be implemented
39 39
 	}
40 40
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 *
59 59
 	 * @return array
60 60
 	 */
61
-	function get_jquery_validation_rule_array(){
61
+	function get_jquery_validation_rule_array() {
62 62
 		return array();
63 63
 	}
64 64
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * the input is invalid. Used for both frontend and backend validation.
68 68
 	 * @return string
69 69
 	 */
70
-	function get_validation_error_message(){
70
+	function get_validation_error_message() {
71 71
 		return $this->_validation_error_message;
72 72
 	}
73 73
 }
74 74
\ No newline at end of file
Please login to merge, or discard this patch.
core/libraries/line_item_display/EE_Line_Item_Display.class.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_Line_Item_Display
5
- *
6
- * Description
7
- *
8
- * @package         Event Espresso
9
- * @subpackage    core
10
- * @author				Brent Christensen
11
- * @since		 	   $VID:$
12
- *
13
- */
3
+  *
4
+  * Class EE_Line_Item_Display
5
+  *
6
+  * Description
7
+  *
8
+  * @package         Event Espresso
9
+  * @subpackage    core
10
+  * @author				Brent Christensen
11
+  * @since		 	   $VID:$
12
+  *
13
+  */
14 14
 class EE_Line_Item_Display {
15 15
 
16 16
 	private $strategy = NULL;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 	 * @param string $context - where/how the line items are being displayed
22 22
 	 * @param string $other_line_item_display_strategy
23 23
 	 */
24
-	public function __construct( $context = '', $other_line_item_display_strategy = '' ) {
25
-		$context = strtolower( $context );
26
-		switch ( $context ) {
24
+	public function __construct($context = '', $other_line_item_display_strategy = '') {
25
+		$context = strtolower($context);
26
+		switch ($context) {
27 27
 			case 'invoice' :
28 28
 				$this->strategy = new EE_Invoice_Line_Item_Display_Strategy();
29 29
 				break;
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 				break;
36 36
 			default :
37 37
 				if (
38
-					! empty( $other_line_item_display_strategy ) &&
39
-					class_exists( $other_line_item_display_strategy )
38
+					! empty($other_line_item_display_strategy) &&
39
+					class_exists($other_line_item_display_strategy)
40 40
 				) {
41 41
 					$this->strategy = new  $other_line_item_display_strategy();
42 42
 				} else {
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	 * @param array        $options
51 51
 	 * @return mixed
52 52
 	 */
53
-	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
54
-		return $this->strategy->display_line_item( $line_item, $options );
53
+	public function display_line_item(EE_Line_Item $line_item, $options = array()) {
54
+		return $this->strategy->display_line_item($line_item, $options);
55 55
 	}
56 56
 
57 57
 
Please login to merge, or discard this patch.
libraries/line_item_display/EE_SPCO_Line_Item_Display_Strategy.strategy.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
  /**
3
- *
4
- * Class EE_SPCO_Line_Item_Display_Strategy
5
- *
6
- * Description
7
- *
8
- * @package         Event Espresso
9
- * @subpackage    core
10
- * @author				Brent Christensen
11
- * @since		 	   $VID:$
12
- *
13
- */
3
+  *
4
+  * Class EE_SPCO_Line_Item_Display_Strategy
5
+  *
6
+  * Description
7
+  *
8
+  * @package         Event Espresso
9
+  * @subpackage    core
10
+  * @author				Brent Christensen
11
+  * @since		 	   $VID:$
12
+  *
13
+  */
14 14
 
15 15
 class EE_SPCO_Line_Item_Display_Strategy implements EEI_Line_Item_Display {
16 16
 
Please login to merge, or discard this patch.
Spacing   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -69,104 +69,104 @@  discard block
 block discarded – undo
69 69
 	 * @param array        $options
70 70
 	 * @return mixed
71 71
 	 */
72
-	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
72
+	public function display_line_item(EE_Line_Item $line_item, $options = array()) {
73 73
 
74
-		EE_Registry::instance()->load_helper( 'Template' );
75
-		EE_Registry::instance()->load_helper( 'HTML' );
74
+		EE_Registry::instance()->load_helper('Template');
75
+		EE_Registry::instance()->load_helper('HTML');
76 76
 
77 77
 		$html = '';
78 78
 		// set some default options and merge with incoming
79 79
 		$default_options = array(
80
-			'show_desc' => true,  // 	true 		false
80
+			'show_desc' => true, // 	true 		false
81 81
 			'odd' => false
82 82
 		);
83
-		$options = array_merge( $default_options, (array)$options );
83
+		$options = array_merge($default_options, (array) $options);
84 84
 
85
-		switch( $line_item->type() ) {
85
+		switch ($line_item->type()) {
86 86
 
87 87
 			case EEM_Line_Item::type_line_item:
88 88
 				$this->_show_taxes = $line_item->is_taxable() ? true : $this->_show_taxes;
89
-				if ( $line_item->OBJ_type() == 'Ticket' ) {
89
+				if ($line_item->OBJ_type() == 'Ticket') {
90 90
 					// item row
91
-					$html .= $this->_ticket_row( $line_item, $options );
91
+					$html .= $this->_ticket_row($line_item, $options);
92 92
 					// got any kids?
93
-					foreach ( $line_item->children() as $child_line_item ) {
94
-						$this->display_line_item( $child_line_item, $options );
93
+					foreach ($line_item->children() as $child_line_item) {
94
+						$this->display_line_item($child_line_item, $options);
95 95
 					}
96 96
 				} else {
97 97
 					// item row
98
-					$html .= $this->_item_row( $line_item, $options );
98
+					$html .= $this->_item_row($line_item, $options);
99 99
 					// got any kids?
100
-					foreach ( $line_item->children() as $child_line_item ) {
101
-						$this->display_line_item( $child_line_item, $options );
100
+					foreach ($line_item->children() as $child_line_item) {
101
+						$this->display_line_item($child_line_item, $options);
102 102
 					}
103 103
 				}
104 104
 				break;
105 105
 
106 106
 			case EEM_Line_Item::type_sub_line_item:
107
-				$html .= $this->_sub_item_row( $line_item, $options );
107
+				$html .= $this->_sub_item_row($line_item, $options);
108 108
 				break;
109 109
 
110 110
 			case EEM_Line_Item::type_sub_total:
111 111
 				static $sub_total = 0;
112 112
 				$event_sub_total = 0;
113
-				$text = __( 'Sub-Total', 'event_espresso' );
114
-				if ( $line_item->OBJ_type() == 'Event' ) {
115
-					$options[ 'event_id' ] = $event_id = $line_item->OBJ_ID();
116
-					if ( ! isset( $this->_events[ $options[ 'event_id' ] ] ) ) {
117
-						$event = EEM_Event::instance()->get_one_by_ID( $options[ 'event_id' ] );
118
-						if ( $event instanceof EE_Event ) {
119
-							if ( $event->default_registration_status() == EEM_Registration::status_id_not_approved ) {
113
+				$text = __('Sub-Total', 'event_espresso');
114
+				if ($line_item->OBJ_type() == 'Event') {
115
+					$options['event_id'] = $event_id = $line_item->OBJ_ID();
116
+					if ( ! isset($this->_events[$options['event_id']])) {
117
+						$event = EEM_Event::instance()->get_one_by_ID($options['event_id']);
118
+						if ($event instanceof EE_Event) {
119
+							if ($event->default_registration_status() == EEM_Registration::status_id_not_approved) {
120 120
 								return '';
121 121
 							}
122 122
 						}
123
-						$this->_events[ $options[ 'event_id' ] ] = 0;
124
-						$html .= $this->_event_row( $line_item );
125
-						$text = __( 'Event Sub-Total', 'event_espresso' );
123
+						$this->_events[$options['event_id']] = 0;
124
+						$html .= $this->_event_row($line_item);
125
+						$text = __('Event Sub-Total', 'event_espresso');
126 126
 					}
127 127
 				}
128 128
 				$child_line_items = $line_item->children();
129 129
 				// loop thru children
130
-				foreach( $child_line_items as $child_line_item ) {
130
+				foreach ($child_line_items as $child_line_item) {
131 131
 					// recursively feed children back into this method
132
-					$html .= $this->display_line_item( $child_line_item, $options );
132
+					$html .= $this->display_line_item($child_line_item, $options);
133 133
 				}
134
-				$event_sub_total += isset( $options[ 'event_id' ] ) ? $this->_events[ $options[ 'event_id' ] ] : 0;
134
+				$event_sub_total += isset($options['event_id']) ? $this->_events[$options['event_id']] : 0;
135 135
 				$sub_total += $event_sub_total;
136 136
 				if (
137 137
 					(
138 138
 						// event subtotals
139 139
 						$line_item->code() != 'pre-tax-subtotal' &&
140
-						count( $child_line_items ) > 1
140
+						count($child_line_items) > 1
141 141
 					)
142 142
 					||
143 143
 					(
144 144
 						// pre-tax subtotals
145 145
 						$line_item->code() == 'pre-tax-subtotal' &&
146
-						count( $this->_events ) > 1
146
+						count($this->_events) > 1
147 147
 					)
148 148
 				) {
149 149
 					$options['sub_total'] = $line_item->OBJ_type() == 'Event' ? $event_sub_total : $sub_total;
150
-					$html .= $this->_sub_total_row( $line_item, $text, $options );
150
+					$html .= $this->_sub_total_row($line_item, $text, $options);
151 151
 				}
152 152
 				break;
153 153
 
154 154
 			case EEM_Line_Item::type_tax:
155
-				if ( $this->_show_taxes ) {
156
-					$this->_taxes_html .= $this->_tax_row( $line_item, $options );
155
+				if ($this->_show_taxes) {
156
+					$this->_taxes_html .= $this->_tax_row($line_item, $options);
157 157
 				}
158 158
 				break;
159 159
 
160 160
 			case EEM_Line_Item::type_tax_sub_total:
161
-				if ( $this->_show_taxes ) {
161
+				if ($this->_show_taxes) {
162 162
 					$child_line_items = $line_item->children();
163 163
 					// loop thru children
164
-					foreach( $child_line_items as $child_line_item ) {
164
+					foreach ($child_line_items as $child_line_item) {
165 165
 						// recursively feed children back into this method
166
-						$html .= $this->display_line_item( $child_line_item, $options );
166
+						$html .= $this->display_line_item($child_line_item, $options);
167 167
 					}
168
-					if ( count( $child_line_items ) > 1 ) {
169
-						$this->_taxes_html .= $this->_total_tax_row( $line_item, __( 'Tax Total', 'event_espresso' ) );
168
+					if (count($child_line_items) > 1) {
169
+						$this->_taxes_html .= $this->_total_tax_row($line_item, __('Tax Total', 'event_espresso'));
170 170
 					}
171 171
 				}
172 172
 				break;
@@ -175,25 +175,25 @@  discard block
 block discarded – undo
175 175
 				// get all child line items
176 176
 				$children = $line_item->children();
177 177
 				// loop thru all non-tax child line items
178
-				foreach( $children as $child_line_item ) {
179
-					if ( $child_line_item->type() != EEM_Line_Item::type_tax_sub_total ) {
178
+				foreach ($children as $child_line_item) {
179
+					if ($child_line_item->type() != EEM_Line_Item::type_tax_sub_total) {
180 180
 						// recursively feed children back into this method
181
-						$html .= $this->display_line_item( $child_line_item, $options );
181
+						$html .= $this->display_line_item($child_line_item, $options);
182 182
 					}
183 183
 				}
184 184
 
185 185
 				// now loop thru  tax child line items
186
-				foreach( $children as $child_line_item ) {
187
-					if ( $child_line_item->type() == EEM_Line_Item::type_tax_sub_total ) {
186
+				foreach ($children as $child_line_item) {
187
+					if ($child_line_item->type() == EEM_Line_Item::type_tax_sub_total) {
188 188
 						// recursively feed children back into this method
189
-						$html .= $this->display_line_item( $child_line_item, $options );
189
+						$html .= $this->display_line_item($child_line_item, $options);
190 190
 					}
191 191
 				}
192 192
 				$html .= $this->_taxes_html;
193
-				$html .= $this->_total_row( $line_item, __('Total', 'event_espresso') );
193
+				$html .= $this->_total_row($line_item, __('Total', 'event_espresso'));
194 194
 
195 195
 
196
-				$html .= $this->_payments_and_amount_owing_rows( $line_item, $options );
196
+				$html .= $this->_payments_and_amount_owing_rows($line_item, $options);
197 197
 				break;
198 198
 
199 199
 		}
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
 	 * @param EE_Line_Item $line_item
209 209
 	 * @return mixed
210 210
 	 */
211
-	private function _event_row( EE_Line_Item $line_item ) {
211
+	private function _event_row(EE_Line_Item $line_item) {
212 212
 		// start of row
213
-		$html = EEH_HTML::tr( '', 'event-cart-total-row', 'total_tr odd' );
213
+		$html = EEH_HTML::tr('', 'event-cart-total-row', 'total_tr odd');
214 214
 		// event name td
215
-		$html .= EEH_HTML::td( EEH_HTML::strong( $line_item->name() ), '', 'event-header', '', ' colspan="4"' );
215
+		$html .= EEH_HTML::td(EEH_HTML::strong($line_item->name()), '', 'event-header', '', ' colspan="4"');
216 216
 		// end of row
217 217
 		$html .= EEH_HTML::trx();
218 218
 		return $html;
@@ -227,10 +227,10 @@  discard block
 block discarded – undo
227 227
 	 * @param array        $options
228 228
 	 * @return mixed
229 229
 	 */
230
-	private function _ticket_row( EE_Line_Item $line_item, $options = array() ) {
230
+	private function _ticket_row(EE_Line_Item $line_item, $options = array()) {
231 231
 		// start of row
232 232
 		$row_class = $options['odd'] ? 'item odd' : 'item';
233
-		$html = EEH_HTML::tr( '', '', $row_class );
233
+		$html = EEH_HTML::tr('', '', $row_class);
234 234
 		// name && desc
235 235
 		$name_and_desc = apply_filters(
236 236
 			'FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__name',
@@ -239,23 +239,23 @@  discard block
 block discarded – undo
239 239
 		);
240 240
 		$name_and_desc .= apply_filters(
241 241
 			'FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__desc',
242
-			( $options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '' ),
242
+			($options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: '.$line_item->desc().'</span>' : ''),
243 243
 			$line_item,
244 244
 			$options
245 245
 		);
246 246
 		$name_and_desc .= $line_item->is_taxable() ? ' * ' : '';
247 247
 		// name td
248
-		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '',  'item_l' );
248
+		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '', 'item_l' );
249 249
 		// price td
250
-		$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '',  'item_c jst-rght' );
250
+		$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
251 251
 		// quantity td
252
-		$html .= EEH_HTML::td( $line_item->quantity(), '', 'item_l jst-rght' );
252
+		$html .= EEH_HTML::td($line_item->quantity(), '', 'item_l jst-rght');
253 253
 		$this->_total_items += $line_item->quantity();
254 254
 		// determine total for line item
255 255
 		$total = $line_item->total();
256
-		$this->_events[ $options[ 'event_id' ] ] += $total;
256
+		$this->_events[$options['event_id']] += $total;
257 257
 		// total td
258
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $total, false, false ), '',  'item_r jst-rght' );
258
+		$html .= EEH_HTML::td(EEH_Template::format_currency($total, false, false), '', 'item_r jst-rght');
259 259
 		// end of row
260 260
 		$html .= EEH_HTML::trx();
261 261
 		return $html;
@@ -270,41 +270,41 @@  discard block
 block discarded – undo
270 270
 	 * @param array        $options
271 271
 	 * @return mixed
272 272
 	 */
273
-	private function _item_row( EE_Line_Item $line_item, $options = array() ) {
273
+	private function _item_row(EE_Line_Item $line_item, $options = array()) {
274 274
 		// start of row
275 275
 		$row_class = $options['odd'] ? 'item odd' : 'item';
276
-		$html = EEH_HTML::tr( '', '', $row_class );
277
-		$obj_name = $line_item->OBJ_type() ? $line_item->OBJ_type() . ': ' : '';
276
+		$html = EEH_HTML::tr('', '', $row_class);
277
+		$obj_name = $line_item->OBJ_type() ? $line_item->OBJ_type().': ' : '';
278 278
 		// name && desc
279 279
 		$name_and_desc = apply_filters(
280 280
 			'FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__name',
281
-			 $obj_name . $line_item->name(),
281
+			 $obj_name.$line_item->name(),
282 282
 			$line_item
283 283
 		);
284 284
 		$name_and_desc .= apply_filters(
285 285
 			'FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__desc',
286
-			( $options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '' ),
286
+			($options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: '.$line_item->desc().'</span>' : ''),
287 287
 			$line_item,
288 288
 			$options
289 289
 		);
290 290
 		$name_and_desc .= $line_item->is_taxable() ? ' * ' : '';
291 291
 		// name td
292
-		$html .= EEH_HTML::td( $name_and_desc, '',  'item_l' );
292
+		$html .= EEH_HTML::td($name_and_desc, '', 'item_l');
293 293
 		// price td
294
-		if ( $line_item->is_percent() ) {
295
-			$html .= EEH_HTML::td( $line_item->percent() . '%', '', 'item_c jst-rght' );
294
+		if ($line_item->is_percent()) {
295
+			$html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c jst-rght');
296 296
 		} else {
297
-			$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '', 'item_c jst-rght' );
297
+			$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
298 298
 		}
299 299
 		// quantity td
300
-		$html .= EEH_HTML::td( $line_item->quantity(), '', 'item_l jst-rght' );
300
+		$html .= EEH_HTML::td($line_item->quantity(), '', 'item_l jst-rght');
301 301
 		//$total = $line_item->total() * $line_item->quantity();
302 302
 		$total = $line_item->total();
303
-		if( isset( $options[ 'event_id' ] ) && isset( $this->_events[ $options[ 'event_id' ] ] ) ) {
304
-			$this->_events[ $options[ 'event_id' ] ] += $total;
303
+		if (isset($options['event_id']) && isset($this->_events[$options['event_id']])) {
304
+			$this->_events[$options['event_id']] += $total;
305 305
 		}
306 306
 		// total td
307
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $total, false, false ), '',  'item_r jst-rght' );
307
+		$html .= EEH_HTML::td(EEH_Template::format_currency($total, false, false), '', 'item_r jst-rght');
308 308
 		// end of row
309 309
 		$html .= EEH_HTML::trx();
310 310
 		return $html;
@@ -319,22 +319,22 @@  discard block
 block discarded – undo
319 319
 	 * @param array        $options
320 320
 	 * @return mixed
321 321
 	 */
322
-	private function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
322
+	private function _sub_item_row(EE_Line_Item $line_item, $options = array()) {
323 323
 		// start of row
324
-		$html = EEH_HTML::tr( '', 'item sub-item-row' );
324
+		$html = EEH_HTML::tr('', 'item sub-item-row');
325 325
 		// name && desc
326 326
 		$name_and_desc = $line_item->name();
327
-		$name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '';
327
+		$name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: '.$line_item->desc().'</span>' : '';
328 328
 		// name td
329
-		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '',  'item_l sub-item' );
329
+		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '', 'item_l sub-item' );
330 330
 		// discount/surcharge td
331
-		if ( $line_item->is_percent() ) {
332
-			$html .= EEH_HTML::td( $line_item->percent() . '%', '',  'item_c' );
331
+		if ($line_item->is_percent()) {
332
+			$html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c');
333 333
 		} else {
334
-			$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '',  'item_c jst-rght' );
334
+			$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
335 335
 		}
336 336
 		// total td
337
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'item_r jst-rght' );
337
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'item_r jst-rght');
338 338
 		// end of row
339 339
 		$html .= EEH_HTML::trx();
340 340
 		return $html;
@@ -349,21 +349,21 @@  discard block
 block discarded – undo
349 349
 	 * @param array        $options
350 350
 	 * @return mixed
351 351
 	 */
352
-	private function _tax_row( EE_Line_Item $line_item, $options = array() ) {
352
+	private function _tax_row(EE_Line_Item $line_item, $options = array()) {
353 353
 		// start of row
354
-		$html = EEH_HTML::tr( '', 'item sub-item tax-total' );
354
+		$html = EEH_HTML::tr('', 'item sub-item tax-total');
355 355
 		// name && desc
356 356
 		$name_and_desc = $line_item->name();
357
-		$name_and_desc .= '<span class="smaller-text lt-grey-text" style="margin:0 0 0 2em;">' . __( ' * taxable items', 'event_espresso' ) . '</span>';
358
-		$name_and_desc .= $options[ 'show_desc' ] ? '<br/>' . $line_item->desc() : '';
357
+		$name_and_desc .= '<span class="smaller-text lt-grey-text" style="margin:0 0 0 2em;">'.__(' * taxable items', 'event_espresso').'</span>';
358
+		$name_and_desc .= $options['show_desc'] ? '<br/>'.$line_item->desc() : '';
359 359
 		// name td
360
-		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '',  'item_l sub-item' );
360
+		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '', 'item_l sub-item' );
361 361
 		// percent td
362
-		$html .= EEH_HTML::td( $line_item->percent() . '%', '',  ' jst-rght', '' );
362
+		$html .= EEH_HTML::td($line_item->percent().'%', '', ' jst-rght', '');
363 363
 		// empty td (price)
364
-		$html .= EEH_HTML::td( EEH_HTML::nbsp() );
364
+		$html .= EEH_HTML::td(EEH_HTML::nbsp());
365 365
 		// total td
366
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'item_r jst-rght' );
366
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'item_r jst-rght');
367 367
 		// end of row
368 368
 		$html .= EEH_HTML::trx();
369 369
 		return $html;
@@ -378,17 +378,17 @@  discard block
 block discarded – undo
378 378
 	 * @param string $text
379 379
 	 * @return mixed
380 380
 	 */
381
-	private function _total_tax_row( EE_Line_Item $line_item, $text = '' ) {
381
+	private function _total_tax_row(EE_Line_Item $line_item, $text = '') {
382 382
 		$html = '';
383
-		if ( $line_item->total() ) {
383
+		if ($line_item->total()) {
384 384
 			// start of row
385
-			$html = EEH_HTML::tr( '', '', 'total_tr odd' );
385
+			$html = EEH_HTML::tr('', '', 'total_tr odd');
386 386
 			// total td
387
-			$html .= EEH_HTML::td( $text, '', 'total_currency total jst-rght', '', ' colspan="2"' );
387
+			$html .= EEH_HTML::td($text, '', 'total_currency total jst-rght', '', ' colspan="2"');
388 388
 			// empty td (price)
389
-			$html .= EEH_HTML::td( EEH_HTML::nbsp() );
389
+			$html .= EEH_HTML::td(EEH_HTML::nbsp());
390 390
 			// total td
391
-			$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '', 'total jst-rght' );
391
+			$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'total jst-rght');
392 392
 			// end of row
393 393
 			$html .= EEH_HTML::trx();
394 394
 		}
@@ -405,15 +405,15 @@  discard block
 block discarded – undo
405 405
 	 * @param array        $options
406 406
 	 * @return mixed
407 407
 	 */
408
-	private function _sub_total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
408
+	private function _sub_total_row(EE_Line_Item $line_item, $text = '', $options = array()) {
409 409
 		$html = '';
410
-		if ( $line_item->total() ) {
410
+		if ($line_item->total()) {
411 411
 			// start of row
412
-			$html = EEH_HTML::tr( '', '', 'total_tr odd' );
412
+			$html = EEH_HTML::tr('', '', 'total_tr odd');
413 413
 			// total td
414
-			$html .= EEH_HTML::td( $text, '', 'total_currency total jst-rght', '', ' colspan="3"' );
414
+			$html .= EEH_HTML::td($text, '', 'total_currency total jst-rght', '', ' colspan="3"');
415 415
 			// total td
416
-			$html .= EEH_HTML::td( EEH_Template::format_currency( $options[ 'sub_total' ], false, false ), '', 'total jst-rght' );
416
+			$html .= EEH_HTML::td(EEH_Template::format_currency($options['sub_total'], false, false), '', 'total jst-rght');
417 417
 			// end of row
418 418
 			$html .= EEH_HTML::trx();
419 419
 		}
@@ -430,13 +430,13 @@  discard block
 block discarded – undo
430 430
 	 * @param string       $text
431 431
 	 * @return mixed
432 432
 	 */
433
-	private function _total_row( EE_Line_Item $line_item, $text = '' ) {
433
+	private function _total_row(EE_Line_Item $line_item, $text = '') {
434 434
 		// start of row
435
-		$html = EEH_HTML::tr( '', '', 'spco-grand-total total_tr odd' );
435
+		$html = EEH_HTML::tr('', '', 'spco-grand-total total_tr odd');
436 436
 		// total td
437
-		$html .= EEH_HTML::td( $text, '',  'total_currency total jst-rght',  '',  ' colspan="3"' );
437
+		$html .= EEH_HTML::td($text, '', 'total_currency total jst-rght', '', ' colspan="3"');
438 438
 		// total td
439
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'total jst-rght' );
439
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'total jst-rght');
440 440
 		// end of row
441 441
 		$html .= EEH_HTML::trx();
442 442
 		return $html;
@@ -451,30 +451,30 @@  discard block
 block discarded – undo
451 451
 	 * @param array        $options
452 452
 	 * @return mixed
453 453
 	 */
454
-	private function _payments_and_amount_owing_rows( EE_Line_Item $line_item, $options = array() ) {
454
+	private function _payments_and_amount_owing_rows(EE_Line_Item $line_item, $options = array()) {
455 455
 		$html = '';
456 456
 		$owing = $line_item->total();
457
-		$transaction = EEM_Transaction::instance()->get_one_by_ID( $line_item->TXN_ID() );
458
-		if ( $transaction instanceof EE_Transaction ) {
457
+		$transaction = EEM_Transaction::instance()->get_one_by_ID($line_item->TXN_ID());
458
+		if ($transaction instanceof EE_Transaction) {
459 459
 			$registration_payments = array();
460
-			$registrations = ! empty( $options['registrations'] )
461
-				? $options[ 'registrations' ]
460
+			$registrations = ! empty($options['registrations'])
461
+				? $options['registrations']
462 462
 				: $transaction->registrations();
463
-			foreach ( $registrations as $registration ) {
464
-				if ( $registration instanceof EE_Registration && $registration->owes_monies_and_can_pay() ) {
463
+			foreach ($registrations as $registration) {
464
+				if ($registration instanceof EE_Registration && $registration->owes_monies_and_can_pay()) {
465 465
 					$registration_payments = $registration_payments + $registration->registration_payments();
466 466
 				}
467 467
 			}
468
-			if ( ! empty( $registration_payments )) {
469
-				foreach ( $registration_payments as $registration_payment ) {
470
-					if ( $registration_payment instanceof EE_Registration_Payment ) {
468
+			if ( ! empty($registration_payments)) {
469
+				foreach ($registration_payments as $registration_payment) {
470
+					if ($registration_payment instanceof EE_Registration_Payment) {
471 471
 						$owing = $owing - $registration_payment->amount();
472 472
 						$payment = $registration_payment->payment();
473
-						if ( $payment instanceof EE_Payment ) {
473
+						if ($payment instanceof EE_Payment) {
474 474
 							$payment_desc = sprintf(
475
-								__( 'Payment%1$s Received: %2$s', 'event_espresso' ),
475
+								__('Payment%1$s Received: %2$s', 'event_espresso'),
476 476
 								$payment->txn_id_chq_nmbr() != ''
477
-									? ' <span class="small-text">(#' . $payment->txn_id_chq_nmbr() . ')</span> '
477
+									? ' <span class="small-text">(#'.$payment->txn_id_chq_nmbr().')</span> '
478 478
 									: '',
479 479
 								$payment->timestamp()
480 480
 							);
@@ -482,12 +482,12 @@  discard block
 block discarded – undo
482 482
 							$payment_desc = '';
483 483
 						}
484 484
 						// start of row
485
-						$html .= EEH_HTML::tr( '', '', 'total_tr odd' );
485
+						$html .= EEH_HTML::tr('', '', 'total_tr odd');
486 486
 						// payment desc
487
-						$html .= EEH_HTML::td( $payment_desc, '', '', '', ' colspan="3"' );
487
+						$html .= EEH_HTML::td($payment_desc, '', '', '', ' colspan="3"');
488 488
 						// total td
489 489
 						$html .= EEH_HTML::td(
490
-							EEH_Template::format_currency( $registration_payment->amount(), false, false ),
490
+							EEH_Template::format_currency($registration_payment->amount(), false, false),
491 491
 							'',
492 492
 							'total jst-rght'
493 493
 						);
@@ -495,17 +495,17 @@  discard block
 block discarded – undo
495 495
 						$html .= EEH_HTML::trx();
496 496
 					}
497 497
 				}
498
-				if ( $line_item->total() ) {
498
+				if ($line_item->total()) {
499 499
 					// start of row
500
-					$html .= EEH_HTML::tr( '', '', 'total_tr odd' );
500
+					$html .= EEH_HTML::tr('', '', 'total_tr odd');
501 501
 					// total td
502 502
 					$html .= EEH_HTML::td(
503 503
 						__('Amount Owing', 'event_espresso'),
504
-						'',  'total_currency total jst-rght',  '',  ' colspan="3"'
504
+						'', 'total_currency total jst-rght', '', ' colspan="3"'
505 505
 					);
506 506
 					// total td
507 507
 					$html .= EEH_HTML::td(
508
-						EEH_Template::format_currency( $owing, false, false ), '',  'total jst-rght'
508
+						EEH_Template::format_currency($owing, false, false), '', 'total jst-rght'
509 509
 					);
510 510
 					// end of row
511 511
 					$html .= EEH_HTML::trx();
Please login to merge, or discard this patch.
Doc Comments   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	/**
68 68
 	 * @param EE_Line_Item $line_item
69 69
 	 * @param array        $options
70
-	 * @return mixed
70
+	 * @return string
71 71
 	 */
72 72
 	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
73 73
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	 *    _event_row - basically a Heading row displayed once above each event's ticket rows
204 204
 	 *
205 205
 	 * @param EE_Line_Item $line_item
206
-	 * @return mixed
206
+	 * @return string
207 207
 	 */
208 208
 	private function _event_row( EE_Line_Item $line_item ) {
209 209
 		// start of row
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 	 *
223 223
 	 * @param EE_Line_Item $line_item
224 224
 	 * @param array        $options
225
-	 * @return mixed
225
+	 * @return string
226 226
 	 */
227 227
 	private function _ticket_row( EE_Line_Item $line_item, $options = array() ) {
228 228
 		// start of row
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	 *
266 266
 	 * @param EE_Line_Item $line_item
267 267
 	 * @param array        $options
268
-	 * @return mixed
268
+	 * @return string
269 269
 	 */
270 270
 	private function _item_row( EE_Line_Item $line_item, $options = array() ) {
271 271
 		// start of row
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 	 *
315 315
 	 * @param EE_Line_Item $line_item
316 316
 	 * @param array        $options
317
-	 * @return mixed
317
+	 * @return string
318 318
 	 */
319 319
 	private function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
320 320
 		// start of row
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 	 *
345 345
 	 * @param EE_Line_Item $line_item
346 346
 	 * @param array        $options
347
-	 * @return mixed
347
+	 * @return string
348 348
 	 */
349 349
 	private function _tax_row( EE_Line_Item $line_item, $options = array() ) {
350 350
 		// start of row
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 	 *
374 374
 	 * @param EE_Line_Item $line_item
375 375
 	 * @param string $text
376
-	 * @return mixed
376
+	 * @return string
377 377
 	 */
378 378
 	private function _total_tax_row( EE_Line_Item $line_item, $text = '' ) {
379 379
 		$html = '';
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 	 * @param EE_Line_Item $line_item
401 401
 	 * @param string       $text
402 402
 	 * @param array        $options
403
-	 * @return mixed
403
+	 * @return string
404 404
 	 */
405 405
 	private function _sub_total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
406 406
 		$html = '';
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 	 *
426 426
 	 * @param EE_Line_Item $line_item
427 427
 	 * @param string       $text
428
-	 * @return mixed
428
+	 * @return string
429 429
 	 */
430 430
 	private function _total_row( EE_Line_Item $line_item, $text = '' ) {
431 431
 		// start of row
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 	 *
447 447
 	 * @param EE_Line_Item $line_item
448 448
 	 * @param array        $options
449
-	 * @return mixed
449
+	 * @return string
450 450
 	 */
451 451
 	private function _payments_and_amount_owing_rows( EE_Line_Item $line_item, $options = array() ) {
452 452
 		$html = '';
Please login to merge, or discard this patch.
core/libraries/line_item_filters/EE_Billable_Line_Item_Filter.class.php 1 patch
Spacing   +11 added lines, -12 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
  * Class EE_Billable_Line_Item_Filter
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 	 * EE_Billable_Line_Item_Filter constructor.
26 26
 	 * @param EE_Registration[] $registrations
27 27
 	 */
28
-	public function __construct( $registrations ) {
29
-		parent::__construct( $this->_remove_unbillable_registrations( $registrations ) );
28
+	public function __construct($registrations) {
29
+		parent::__construct($this->_remove_unbillable_registrations($registrations));
30 30
 	}
31 31
 
32 32
 
@@ -39,25 +39,24 @@  discard block
 block discarded – undo
39 39
 	 * @param EE_Registration[] $registrations
40 40
 	 * @return mixed
41 41
 	 */
42
-	protected function _remove_unbillable_registrations( $registrations = array() ) {
43
-		if ( ! empty( $registrations ) ) {
42
+	protected function _remove_unbillable_registrations($registrations = array()) {
43
+		if ( ! empty($registrations)) {
44 44
 			// these reg statuses require payment (if event is not free)
45 45
 			$requires_payment = EEM_Registration::reg_statuses_that_allow_payment();
46
-			foreach ( $registrations as $key => $registration ) {
47
-				if ( ! $registration instanceof EE_Registration ) {
46
+			foreach ($registrations as $key => $registration) {
47
+				if ( ! $registration instanceof EE_Registration) {
48 48
 					continue;
49 49
 				}
50 50
 				// are we billing for this registration at this moment ?
51
-				if ( !
52
-					$registration->owes_monies_and_can_pay( $requires_payment ) &&
51
+				if ( ! $registration->owes_monies_and_can_pay($requires_payment) &&
53 52
 					! (
54 53
 						// free registration with valid reg status
55 54
 						$registration->final_price() == 0 &&
56
-						in_array( $registration->status_ID(), $requires_payment )
55
+						in_array($registration->status_ID(), $requires_payment)
57 56
 					)
58 57
 				) {
59 58
 					// not billable. remove it
60
-					unset( $registrations[ $key ] );
59
+					unset($registrations[$key]);
61 60
 				}
62 61
 			}
63 62
 		}
Please login to merge, or discard this patch.