Completed
Branch BUG-7514-7935-7936-price-order (518ae6)
by
unknown
21:07 queued 12:33
created
strategies/sensitive_data_removal/EE_No_Sensitive_Data_Removal.strategy.php 2 patches
Spacing   +2 added lines, -2 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
 /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-class EE_No_Sensitive_Data_Removal extends EE_Sensitive_Data_Removal_Base{
28
+class EE_No_Sensitive_Data_Removal extends EE_Sensitive_Data_Removal_Base {
29 29
 	public function remove_sensitive_data($normalized_value) {
30 30
 		return $normalized_value;
31 31
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 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
Please login to merge, or discard this patch.
sensitive_data_removal/EE_Sensitive_Data_Removal_Base.strategy.php 2 patches
Spacing   +2 added lines, -2 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
 /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-abstract class EE_Sensitive_Data_Removal_Base extends EE_Form_Input_Strategy_Base{
28
+abstract class EE_Sensitive_Data_Removal_Base extends EE_Form_Input_Strategy_Base {
29 29
 	/**
30 30
 	 * Removes all the sensitive data from this normalized value.
31 31
 	 * For example, should could 'mask' a credit card from 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 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
Please login to merge, or discard this patch.
strategies/validation/EE_Credit_Card_Validation_Strategy.strategy.php 3 patches
Spacing   +10 added lines, -10 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_Credit_Card_Validation_Strategy extends EE_Text_Validation_Strategy{
13
+class EE_Credit_Card_Validation_Strategy extends EE_Text_Validation_Strategy {
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 ){
18
+	public function __construct($validation_error_message = NULL) {
19
+		if ( ! $validation_error_message) {
20 20
 			$validation_error_message = __("Please enter a valid credit card number", "event_espresso");
21 21
 		}
22
-		parent::__construct( $validation_error_message );
22
+		parent::__construct($validation_error_message);
23 23
 	}
24 24
 
25 25
 	/**
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 	 * @return void
30 30
 	 */
31 31
 	function validate($normalized_value) {
32
-		if( $normalized_value && ! $this->verify_is_credit_card($normalized_value)){
33
-			throw new EE_Validation_Error( $this->get_validation_error_message(), 'required');
32
+		if ($normalized_value && ! $this->verify_is_credit_card($normalized_value)) {
33
+			throw new EE_Validation_Error($this->get_validation_error_message(), 'required');
34 34
 		}
35 35
 	}
36 36
 
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @return array
43 43
 	 */
44
-	function get_jquery_validation_rule_array(){
45
-		return array('creditcard'=>true, 'messages' => array( 'creditcard' => $this->get_validation_error_message() ) );
44
+	function get_jquery_validation_rule_array() {
45
+		return array('creditcard'=>true, 'messages' => array('creditcard' => $this->get_validation_error_message()));
46 46
 	}
47 47
 
48 48
 	/**
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
 	 * @param string $card_number
51 51
 	 * @return boolean
52 52
 	 */
53
-	private function verify_is_credit_card($card_number){
53
+	private function verify_is_credit_card($card_number) {
54 54
 		//Credit card: All major cards
55 55
 		$regex = '~^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$~';
56 56
 		if (preg_match($regex, $card_number) || empty($card_number)) {
57 57
 			return true;
58
-		}else{
58
+		} else {
59 59
 			return false;
60 60
 		}
61 61
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 		$regex = '~^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$~';
56 56
 		if (preg_match($regex, $card_number) || empty($card_number)) {
57 57
 			return true;
58
-		}else{
58
+		} else{
59 59
 			return false;
60 60
 		}
61 61
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 class EE_Credit_Card_Validation_Strategy extends EE_Text_Validation_Strategy{
14 14
 
15 15
 	/**
16
-	 * @param null $validation_error_message
16
+	 * @param boolean|null $validation_error_message
17 17
 	 */
18 18
 	public function __construct( $validation_error_message = NULL ) {
19 19
 		if( ! $validation_error_message ){
Please login to merge, or discard this patch.
strategies/validation/EE_Enum_Validation_Strategy.strategy.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,20 +19,20 @@  discard block
 block discarded – undo
19 19
 	 */
20 20
 	function validate($normalized_value) {
21 21
 		parent::validate($normalized_value);
22
-		if( ! $this->_input instanceof EE_Form_Input_With_Options_Base){
22
+		if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) {
23 23
 			throw new EE_Error(sprintf(__("Cannot use Enum Validation Strategy with an input that doesn't have options", "event_espresso")));
24 24
 		}
25 25
 		$enum_options = $this->_input->flat_options();
26
-		if( $normalized_value === TRUE){
26
+		if ($normalized_value === TRUE) {
27 27
 			$normalized_value = 1;
28
-		}elseif( $normalized_value === FALSE){
28
+		}elseif ($normalized_value === FALSE) {
29 29
 			$normalized_value = 0;
30 30
 		}
31
-		if( $normalized_value !== NULL && ! array_key_exists( $normalized_value, $enum_options )){
32
-			throw new EE_Validation_Error( $this->get_validation_error_message(),
31
+		if ($normalized_value !== NULL && ! array_key_exists($normalized_value, $enum_options)) {
32
+			throw new EE_Validation_Error($this->get_validation_error_message(),
33 33
 				'invalid_enum_value'
34 34
 			);
35
-		}else{
35
+		} else {
36 36
 			return true;
37 37
 		}
38 38
 	}
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
 	 * on the allowed options.
43 43
 	 * @return string
44 44
 	 */
45
-	public function get_validation_error_message(){
45
+	public function get_validation_error_message() {
46 46
 		$parent_validation_error_message = parent::get_validation_error_message();
47
-		if( ! $parent_validation_error_message ) {
47
+		if ( ! $parent_validation_error_message) {
48 48
 			$enum_options = $this->_input instanceof EE_Form_Input_With_Options_Base ? $this->_input->flat_options() : '';
49 49
 			return sprintf(
50 50
 					__("This is not allowed option. Allowed options are %s.", "event_espresso"),
51
-					implode( ', ', $enum_options )
51
+					implode(', ', $enum_options)
52 52
 				);
53
-		}else{
53
+		} else {
54 54
 			return $parent_validation_error_message;
55 55
 		}
56 56
 	}
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,14 +25,14 @@  discard block
 block discarded – undo
25 25
 		$enum_options = $this->_input->flat_options();
26 26
 		if( $normalized_value === TRUE){
27 27
 			$normalized_value = 1;
28
-		}elseif( $normalized_value === FALSE){
28
+		} elseif( $normalized_value === FALSE){
29 29
 			$normalized_value = 0;
30 30
 		}
31 31
 		if( $normalized_value !== NULL && ! array_key_exists( $normalized_value, $enum_options )){
32 32
 			throw new EE_Validation_Error( $this->get_validation_error_message(),
33 33
 				'invalid_enum_value'
34 34
 			);
35
-		}else{
35
+		} else{
36 36
 			return true;
37 37
 		}
38 38
 	}
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 					__("This is not allowed option. Allowed options are %s.", "event_espresso"),
51 51
 					implode( ', ', $enum_options )
52 52
 				);
53
-		}else{
53
+		} else{
54 54
 			return $parent_validation_error_message;
55 55
 		}
56 56
 	}
Please login to merge, or discard this patch.
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_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_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   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 	/**
19 19
 	 * @param $context - where/how the line items are being displayed
20 20
 	 */
21
-	public function __construct( $context ) {
22
-		$context = strtolower( $context );
23
-		switch ( $context ) {
21
+	public function __construct($context) {
22
+		$context = strtolower($context);
23
+		switch ($context) {
24 24
 			case 'invoice' :
25 25
 				$this->strategy = new EE_Invoice_Line_Item_Display_Strategy();
26 26
 				break;
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 	 * @param array        $options
41 41
 	 * @return mixed
42 42
 	 */
43
-	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
44
-		return $this->strategy->display_line_item( $line_item, $options );
43
+	public function display_line_item(EE_Line_Item $line_item, $options = array()) {
44
+		return $this->strategy->display_line_item($line_item, $options);
45 45
 	}
46 46
 
47 47
 }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 * @param array        $options
59 59
 	 * @return mixed
60 60
 	 */
61
-	public function display_line_item( EE_Line_Item $line_item, $options = array() );
61
+	public function display_line_item(EE_Line_Item $line_item, $options = array());
62 62
 
63 63
 }
64 64
 // End of file EE_Line_Item_Display.class.php
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.
Doc Comments   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	/**
20 20
 	 * @param EE_Line_Item $line_item
21 21
 	 * @param array        $options
22
-	 * @return mixed
22
+	 * @return string
23 23
 	 */
24 24
 	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
25 25
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 *
103 103
 	 * @param EE_Line_Item $line_item
104 104
 	 * @param array        $options
105
-	 * @return mixed
105
+	 * @return string
106 106
 	 */
107 107
 	private function _item_row( EE_Line_Item $line_item, $options = array() ) {
108 108
 		// start of row
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 *
144 144
 	 * @param EE_Line_Item $line_item
145 145
 	 * @param array        $options
146
-	 * @return mixed
146
+	 * @return string
147 147
 	 */
148 148
 	private function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
149 149
 		// start of row
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 	 *
174 174
 	 * @param EE_Line_Item $line_item
175 175
 	 * @param array        $options
176
-	 * @return mixed
176
+	 * @return string
177 177
 	 */
178 178
 	private function _tax_row( EE_Line_Item $line_item, $options = array() ) {
179 179
 		// start of row
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	 * @param EE_Line_Item $line_item
201 201
 	 * @param string       $text
202 202
 	 * @param array        $options
203
-	 * @return mixed
203
+	 * @return string
204 204
 	 */
205 205
 	private function _sub_total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
206 206
 		if ( $line_item->total() ) {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	 * @param EE_Line_Item $line_item
218 218
 	 * @param string       $text
219 219
 	 * @param array        $options
220
-	 * @return mixed
220
+	 * @return string
221 221
 	 */
222 222
 	private function _total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
223 223
 		$html = '';
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 	 * 	_payments_and_amount_owing_rows
241 241
 	 *
242 242
 	 * @param EE_Line_Item $line_item
243
-	 * @return mixed
243
+	 * @return string
244 244
 	 */
245 245
 	private function _payments_and_amount_owing_rows( EE_Line_Item $line_item ) {
246 246
 		$html = '';
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	 * 	_separator_row
289 289
 	 *
290 290
 	 * @param array        $options
291
-	 * @return mixed
291
+	 * @return string
292 292
 	 */
293 293
 	private function _separator_row( $options = array() ) {
294 294
 		// start of row
Please login to merge, or discard this patch.
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -21,73 +21,73 @@  discard block
 block discarded – undo
21 21
 	 * @param array        $options
22 22
 	 * @return mixed
23 23
 	 */
24
-	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
24
+	public function display_line_item(EE_Line_Item $line_item, $options = array()) {
25 25
 
26
-		EE_Registry::instance()->load_helper( 'Template' );
27
-		EE_Registry::instance()->load_helper( 'HTML' );
26
+		EE_Registry::instance()->load_helper('Template');
27
+		EE_Registry::instance()->load_helper('HTML');
28 28
 
29 29
 		$html = '';
30 30
 		// set some default options and merge with incoming
31 31
 		$default_options = array(
32
-			'show_desc' => TRUE,  // 	TRUE 		FALSE
32
+			'show_desc' => TRUE, // 	TRUE 		FALSE
33 33
 			'odd' => FALSE
34 34
 		);
35
-		$options = array_merge( $default_options, (array)$options );
35
+		$options = array_merge($default_options, (array) $options);
36 36
 
37
-		switch( $line_item->type() ) {
37
+		switch ($line_item->type()) {
38 38
 
39 39
 			case EEM_Line_Item::type_line_item:
40 40
 				// item row
41
-				$html .= $this->_item_row( $line_item, $options );
41
+				$html .= $this->_item_row($line_item, $options);
42 42
 				// got any kids?
43
-				foreach( $line_item->children() as $child_line_item ) {
44
-					$this->display_line_item( $child_line_item, $options );
43
+				foreach ($line_item->children() as $child_line_item) {
44
+					$this->display_line_item($child_line_item, $options);
45 45
 				}
46 46
 				break;
47 47
 
48 48
 			case EEM_Line_Item::type_sub_line_item:
49
-				$html .= $this->_sub_item_row( $line_item, $options );
49
+				$html .= $this->_sub_item_row($line_item, $options);
50 50
 				break;
51 51
 
52 52
 			case EEM_Line_Item::type_sub_total:
53 53
 				static $sub_total = 0;
54 54
 				$child_line_items = $line_item->children();
55 55
 				// loop thru children
56
-				foreach( $child_line_items as $child_line_item ) {
56
+				foreach ($child_line_items as $child_line_item) {
57 57
 					// recursively feed children back into this method
58
-					$html .= $this->display_line_item( $child_line_item, $options );
58
+					$html .= $this->display_line_item($child_line_item, $options);
59 59
 				}
60
-				if ( $line_item->total() != $sub_total && count( $child_line_items ) > 1 ) {
61
-					$html .= $this->_sub_total_row( $line_item, __('Sub-Total', 'event_espresso'), $options );
60
+				if ($line_item->total() != $sub_total && count($child_line_items) > 1) {
61
+					$html .= $this->_sub_total_row($line_item, __('Sub-Total', 'event_espresso'), $options);
62 62
 					$sub_total = $line_item->total();
63 63
 				}
64 64
 				break;
65 65
 
66 66
 			case EEM_Line_Item::type_tax:
67
-				if ( $this->_show_taxes ) {
68
-					$html .= $this->_tax_row( $line_item, $options );
67
+				if ($this->_show_taxes) {
68
+					$html .= $this->_tax_row($line_item, $options);
69 69
 				}
70 70
 				break;
71 71
 
72 72
 			case EEM_Line_Item::type_tax_sub_total:
73
-				if ( $this->_show_taxes ) {
73
+				if ($this->_show_taxes) {
74 74
 					// loop thru children
75
-					foreach( $line_item->children() as $child_line_item ) {
75
+					foreach ($line_item->children() as $child_line_item) {
76 76
 						// recursively feed children back into this method
77
-						$html .= $this->display_line_item( $child_line_item, $options );
77
+						$html .= $this->display_line_item($child_line_item, $options);
78 78
 					}
79
-					$html .= $this->_total_row( $line_item, __('Tax Total', 'event_espresso'), $options );
79
+					$html .= $this->_total_row($line_item, __('Tax Total', 'event_espresso'), $options);
80 80
 				}
81 81
 				break;
82 82
 
83 83
 			case EEM_Line_Item::type_total:
84 84
 				// loop thru children
85
-				foreach( $line_item->children() as $child_line_item ) {
85
+				foreach ($line_item->children() as $child_line_item) {
86 86
 					// recursively feed children back into this method
87
-					$html .= $this->display_line_item( $child_line_item, $options );
87
+					$html .= $this->display_line_item($child_line_item, $options);
88 88
 				}
89
-				$html .= $this->_total_row( $line_item, __('Total', 'event_espresso'), $options );
90
-				$html .= $this->_payments_and_amount_owing_rows( $line_item );
89
+				$html .= $this->_total_row($line_item, __('Total', 'event_espresso'), $options);
90
+				$html .= $this->_payments_and_amount_owing_rows($line_item);
91 91
 				break;
92 92
 
93 93
 		}
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
 	 * @param array        $options
105 105
 	 * @return mixed
106 106
 	 */
107
-	private function _item_row( EE_Line_Item $line_item, $options = array() ) {
107
+	private function _item_row(EE_Line_Item $line_item, $options = array()) {
108 108
 		// start of row
109 109
 		$row_class = $options['odd'] ? 'item odd' : 'item';
110
-		$html = EEH_HTML::tr( '', '', $row_class );
110
+		$html = EEH_HTML::tr('', '', $row_class);
111 111
 		// name && desc
112 112
 		$name_and_desc = apply_filters(
113 113
 			'FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__name',
@@ -116,21 +116,21 @@  discard block
 block discarded – undo
116 116
 		);
117 117
 		$name_and_desc .= apply_filters(
118 118
 			'FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__desc',
119
-			( $options['show_desc'] ? ' : ' . $line_item->desc() : '' ),
119
+			($options['show_desc'] ? ' : '.$line_item->desc() : ''),
120 120
 			$line_item,
121 121
 			$options
122 122
 		);
123 123
 		// name td
124
-		$html .= EEH_HTML::td( $name_and_desc, '',  'item_l' );
124
+		$html .= EEH_HTML::td($name_and_desc, '', 'item_l');
125 125
 		// quantity td
126
-		$html .= EEH_HTML::td( $line_item->quantity(), '',  'item_l jst-rght' );
126
+		$html .= EEH_HTML::td($line_item->quantity(), '', 'item_l jst-rght');
127 127
 		// price td
128
-		$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '',  'item_c jst-rght' );
128
+		$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
129 129
 		// total td
130
-		$total = EEH_Template::format_currency( $line_item->total(), false, false );
130
+		$total = EEH_Template::format_currency($line_item->total(), false, false);
131 131
 		$total .= $line_item->is_taxable() ? '*' : '';
132 132
 		$this->_show_taxes = $line_item->is_taxable() ? TRUE : $this->_show_taxes;
133
-		$html .= EEH_HTML::td( $total, '',  'item_r jst-rght' );
133
+		$html .= EEH_HTML::td($total, '', 'item_r jst-rght');
134 134
 		// end of row
135 135
 		$html .= EEH_HTML::trx();
136 136
 		return $html;
@@ -145,22 +145,22 @@  discard block
 block discarded – undo
145 145
 	 * @param array        $options
146 146
 	 * @return mixed
147 147
 	 */
148
-	private function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
148
+	private function _sub_item_row(EE_Line_Item $line_item, $options = array()) {
149 149
 		// start of row
150
-		$html = EEH_HTML::tr( '', 'item sub-item-row' );
150
+		$html = EEH_HTML::tr('', 'item sub-item-row');
151 151
 		// name && desc
152 152
 		$name_and_desc = $line_item->name();
153
-		$name_and_desc .= $options['show_desc'] ? ' : ' . $line_item->desc() : '';
153
+		$name_and_desc .= $options['show_desc'] ? ' : '.$line_item->desc() : '';
154 154
 		// name td
155
-		$html .= EEH_HTML::td( $name_and_desc, '',  'item_l sub-item' );
155
+		$html .= EEH_HTML::td($name_and_desc, '', 'item_l sub-item');
156 156
 		// discount/surcharge td
157
-		if ( $line_item->is_percent() ) {
158
-			$html .= EEH_HTML::td( $line_item->percent() . '%', '',  'item_c' );
157
+		if ($line_item->is_percent()) {
158
+			$html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c');
159 159
 		} else {
160
-			$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '',  'item_c jst-rght' );
160
+			$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
161 161
 		}
162 162
 		// total td
163
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'item_r jst-rght' );
163
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'item_r jst-rght');
164 164
 		// end of row
165 165
 		$html .= EEH_HTML::trx();
166 166
 		return $html;
@@ -175,18 +175,18 @@  discard block
 block discarded – undo
175 175
 	 * @param array        $options
176 176
 	 * @return mixed
177 177
 	 */
178
-	private function _tax_row( EE_Line_Item $line_item, $options = array() ) {
178
+	private function _tax_row(EE_Line_Item $line_item, $options = array()) {
179 179
 		// start of row
180
-		$html = EEH_HTML::tr( '', 'item sub-item tax-total' );
180
+		$html = EEH_HTML::tr('', 'item sub-item tax-total');
181 181
 		// name && desc
182 182
 		$name_and_desc = $line_item->name();
183
-		$name_and_desc .= $options['show_desc'] ? ' : ' . $line_item->desc() : '';
183
+		$name_and_desc .= $options['show_desc'] ? ' : '.$line_item->desc() : '';
184 184
 		// name td
185
-		$html .= EEH_HTML::td( $name_and_desc, '',  'item_l sub-item', '', ' colspan="2"' );
185
+		$html .= EEH_HTML::td($name_and_desc, '', 'item_l sub-item', '', ' colspan="2"');
186 186
 		// percent td
187
-		$html .= EEH_HTML::td( $line_item->percent() . '%', '',  'item_c', '' );
187
+		$html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c', '');
188 188
 		// total td
189
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'item_r jst-rght' );
189
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'item_r jst-rght');
190 190
 		// end of row
191 191
 		$html .= EEH_HTML::trx();
192 192
 		return $html;
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
 	 * @param array        $options
203 203
 	 * @return mixed
204 204
 	 */
205
-	private function _sub_total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
206
-		if ( $line_item->total() ) {
207
-			return $this->_total_row( $line_item, $text, $options);
205
+	private function _sub_total_row(EE_Line_Item $line_item, $text = '', $options = array()) {
206
+		if ($line_item->total()) {
207
+			return $this->_total_row($line_item, $text, $options);
208 208
 		}
209 209
 		return '';
210 210
 	}
@@ -219,15 +219,15 @@  discard block
 block discarded – undo
219 219
 	 * @param array        $options
220 220
 	 * @return mixed
221 221
 	 */
222
-	private function _total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
222
+	private function _total_row(EE_Line_Item $line_item, $text = '', $options = array()) {
223 223
 		$html = '';
224
-		if ( $line_item->total() ) {
224
+		if ($line_item->total()) {
225 225
 			// start of row
226
-			$html = EEH_HTML::tr( '', '', 'total_tr odd' );
226
+			$html = EEH_HTML::tr('', '', 'total_tr odd');
227 227
 			// total td
228
-			$html .= EEH_HTML::td( $text, '',  'total_currency total jst-rght',  '',  ' colspan="3"' );
228
+			$html .= EEH_HTML::td($text, '', 'total_currency total jst-rght', '', ' colspan="3"');
229 229
 			// total td
230
-			$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'total jst-rght' );
230
+			$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'total jst-rght');
231 231
 			// end of row
232 232
 			$html .= EEH_HTML::trx();
233 233
 		}
@@ -242,38 +242,38 @@  discard block
 block discarded – undo
242 242
 	 * @param EE_Line_Item $line_item
243 243
 	 * @return mixed
244 244
 	 */
245
-	private function _payments_and_amount_owing_rows( EE_Line_Item $line_item ) {
245
+	private function _payments_and_amount_owing_rows(EE_Line_Item $line_item) {
246 246
 		$html = '';
247
-		$transaction = EEM_Transaction::instance()->get_one_by_ID( $line_item->TXN_ID() );
248
-		if ( $transaction instanceof EE_Transaction ) {
247
+		$transaction = EEM_Transaction::instance()->get_one_by_ID($line_item->TXN_ID());
248
+		if ($transaction instanceof EE_Transaction) {
249 249
 			$payments = $transaction->approved_payments();
250
-			if ( ! empty( $payments )) {
250
+			if ( ! empty($payments)) {
251 251
 				$owing = $line_item->total();
252
-				foreach ( $payments as $payment ) {
253
-					if ( $payment instanceof EE_Payment ) {
252
+				foreach ($payments as $payment) {
253
+					if ($payment instanceof EE_Payment) {
254 254
 						$owing = $owing - $payment->amount();
255 255
 						$payment_desc = sprintf(
256 256
 							__('Payment%1$s Received: %2$s', 'event_espresso'),
257
-							$payment->txn_id_chq_nmbr() != '' ? ' ' . $payment->txn_id_chq_nmbr() : '',
257
+							$payment->txn_id_chq_nmbr() != '' ? ' '.$payment->txn_id_chq_nmbr() : '',
258 258
 							$payment->timestamp()
259 259
 						);
260 260
 						// start of row
261
-						$html .= EEH_HTML::tr( '', '', 'total_tr odd' );
261
+						$html .= EEH_HTML::tr('', '', 'total_tr odd');
262 262
 						// payment desc
263
-						$html .= EEH_HTML::td( $payment_desc, '',  '',  '',  ' colspan="3"' );
263
+						$html .= EEH_HTML::td($payment_desc, '', '', '', ' colspan="3"');
264 264
 						// total td
265
-						$html .= EEH_HTML::td( EEH_Template::format_currency( $payment->amount(), false, false ), '',  'total jst-rght' );
265
+						$html .= EEH_HTML::td(EEH_Template::format_currency($payment->amount(), false, false), '', 'total jst-rght');
266 266
 						// end of row
267 267
 						$html .= EEH_HTML::trx();
268 268
 					}
269 269
 				}
270
-				if ( $line_item->total() ) {
270
+				if ($line_item->total()) {
271 271
 					// start of row
272
-					$html .= EEH_HTML::tr( '', '', 'total_tr odd' );
272
+					$html .= EEH_HTML::tr('', '', 'total_tr odd');
273 273
 					// total td
274
-					$html .= EEH_HTML::td( __('Amount Owing', 'event_espresso'), '',  'total_currency total jst-rght',  '',  ' colspan="3"' );
274
+					$html .= EEH_HTML::td(__('Amount Owing', 'event_espresso'), '', 'total_currency total jst-rght', '', ' colspan="3"');
275 275
 					// total td
276
-					$html .= EEH_HTML::td( EEH_Template::format_currency( $owing, false, false ), '',  'total jst-rght' );
276
+					$html .= EEH_HTML::td(EEH_Template::format_currency($owing, false, false), '', 'total jst-rght');
277 277
 					// end of row
278 278
 					$html .= EEH_HTML::trx();
279 279
 				}
@@ -290,9 +290,9 @@  discard block
 block discarded – undo
290 290
 	 * @param array        $options
291 291
 	 * @return mixed
292 292
 	 */
293
-	private function _separator_row( $options = array() ) {
293
+	private function _separator_row($options = array()) {
294 294
 		// start of row
295
-		$html = EEH_HTML::tr( EEH_HTML::td( '<hr>', '',  '',  '',  ' colspan="4"' ));
295
+		$html = EEH_HTML::tr(EEH_HTML::td('<hr>', '', '', '', ' colspan="4"'));
296 296
 		return $html;
297 297
 	}
298 298
 
Please login to merge, or discard this patch.