Completed
Branch FET-8162-relation-exists (8f4753)
by
unknown
32:32 queued 23:52
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_Max_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_Max_Length_Validation_Strategy extends EE_Validation_Strategy_Base{
11
+class EE_Max_Length_Validation_Strategy extends EE_Validation_Strategy_Base {
12 12
 
13 13
 	protected $_max_length;
14 14
 
15
-	public function __construct( $validation_error_message = NULL, $max_length = INF ) {
15
+	public function __construct($validation_error_message = NULL, $max_length = INF) {
16 16
 		$this->_max_length = $max_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->_max_length !== INF &&
24
+		if ($this->_max_length !== INF &&
25 25
 				$normalized_value &&
26
-				is_string( $normalized_value ) &&
27
-				 strlen( $normalized_value ) > $this->_max_length){
28
-			throw new EE_Validation_Error( $this->get_validation_error_message(), 'maxlength' );
26
+				is_string($normalized_value) &&
27
+				 strlen($normalized_value) > $this->_max_length) {
28
+			throw new EE_Validation_Error($this->get_validation_error_message(), 'maxlength');
29 29
 		}
30 30
 	}
31 31
 
32 32
 	/**
33 33
 	 * @return array
34 34
 	 */
35
-	function get_jquery_validation_rule_array(){
36
-		return array( 'maxlength'=> $this->_max_length, 'messages' => array( 'maxlength' => $this->get_validation_error_message() ) );
35
+	function get_jquery_validation_rule_array() {
36
+		return array('maxlength'=> $this->_max_length, 'messages' => array('maxlength' => $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_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.
core/libraries/messages/EE_Messages_Base.lib.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
3 3
 	exit('NO direct script access allowed');
4 4
 
5 5
 /**
@@ -185,14 +185,14 @@  discard block
 block discarded – undo
185 185
 	 * @access protected
186 186
 	 * @return void
187 187
 	 */
188
-	protected function _set_existing_admin_settings( $messenger = NULL ) {
188
+	protected function _set_existing_admin_settings($messenger = NULL) {
189 189
 		$active_messengers = EEH_MSG_Template::get_active_messengers_in_db();
190
-		$active_message_types = !empty( $messenger ) ? $active_messengers[$messenger]['settings'][$messenger . '-message_types'] : array();
190
+		$active_message_types = ! empty($messenger) ? $active_messengers[$messenger]['settings'][$messenger.'-message_types'] : array();
191 191
 
192 192
 
193 193
 		$actives = $this->_messages_item_type == 'messenger' ? $active_messengers : $active_message_types;
194 194
 
195
-		$this->_existing_admin_settings = isset($actives[$this->name]['settings'] ) ? $actives[$this->name]['settings'] : null;
195
+		$this->_existing_admin_settings = isset($actives[$this->name]['settings']) ? $actives[$this->name]['settings'] : null;
196 196
 	}
197 197
 
198 198
 
@@ -207,10 +207,10 @@  discard block
 block discarded – undo
207 207
 	 * @access public
208 208
 	 * @return array          settings
209 209
 	 */
210
-	public function get_existing_admin_settings( $messenger = NULL ) {
210
+	public function get_existing_admin_settings($messenger = NULL) {
211 211
 		// if admin_settings property empty lets try setting it.
212
-		if ( method_exists($this, '_set_existing_admin_settings') && empty( $this->_existing_admin_settings ) )
213
-			$this->_set_existing_admin_settings( $messenger );
212
+		if (method_exists($this, '_set_existing_admin_settings') && empty($this->_existing_admin_settings))
213
+			$this->_set_existing_admin_settings($messenger);
214 214
 
215 215
 		return EEH_Class_Tools::has_property($this, '_existing_admin_settings') ? $this->_existing_admin_settings : null;
216 216
 	}
@@ -225,10 +225,10 @@  discard block
 block discarded – undo
225 225
 	 * @return array   an array of valid shortcodes.
226 226
 	 */
227 227
 	public function get_valid_shortcodes() {
228
-		$valid_shortcodes = apply_filters( 'FHEE__' . get_class($this) . '__get_valid_shortcodes', $this->_valid_shortcodes, $this );
228
+		$valid_shortcodes = apply_filters('FHEE__'.get_class($this).'__get_valid_shortcodes', $this->_valid_shortcodes, $this);
229 229
 
230 230
 		//The below filter applies to ALL messengers and message types so use with care!
231
-		$valid_shortcodes = apply_filters( 'FHEE__EE_Messages_Base__get_valid_shortcodes', $valid_shortcodes, $this );
231
+		$valid_shortcodes = apply_filters('FHEE__EE_Messages_Base__get_valid_shortcodes', $valid_shortcodes, $this);
232 232
 		return $valid_shortcodes;
233 233
 	}
234 234
 
@@ -259,17 +259,17 @@  discard block
 block discarded – undo
259 259
 	 * @access protected
260 260
 	 * @return string $content for page.
261 261
 	 */
262
-	protected function _get_admin_page_content( $page, $action, $extra, $actives ) {
262
+	protected function _get_admin_page_content($page, $action, $extra, $actives) {
263 263
 		//we can also further refine the context by action (if present).
264
-		if ( !empty($action) ) {
265
-			$page = $page . '_' . $action;
264
+		if ( ! empty($action)) {
265
+			$page = $page.'_'.$action;
266 266
 		}
267 267
 
268
-		if ( !isset( $this->admin_registered_pages[$page]) )
268
+		if ( ! isset($this->admin_registered_pages[$page]))
269 269
 			return false; //todo: a place to throw an exception?  We need to indicate there is no registered page so this function is not being called correctly.
270 270
 
271 271
 		//k made it here so let's call the method
272
-		if ( FALSE === ( $content = call_user_func_array( array( $this, '_get_admin_content_' . $page), array($actives, $extra) ) ) ) {
272
+		if (FALSE === ($content = call_user_func_array(array($this, '_get_admin_content_'.$page), array($actives, $extra)))) {
273 273
 			return false; //todo this needs to be an exception once we've got exceptions in place.
274 274
 		}
275 275
 		return $content;
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!defined('EVENT_ESPRESSO_VERSION') )
2
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
3 3
 	exit('NO direct script access allowed');
4
+}
4 5
 
5 6
 /**
6 7
  * Event Espresso
@@ -209,8 +210,9 @@  discard block
 block discarded – undo
209 210
 	 */
210 211
 	public function get_existing_admin_settings( $messenger = NULL ) {
211 212
 		// if admin_settings property empty lets try setting it.
212
-		if ( method_exists($this, '_set_existing_admin_settings') && empty( $this->_existing_admin_settings ) )
213
-			$this->_set_existing_admin_settings( $messenger );
213
+		if ( method_exists($this, '_set_existing_admin_settings') && empty( $this->_existing_admin_settings ) ) {
214
+					$this->_set_existing_admin_settings( $messenger );
215
+		}
214 216
 
215 217
 		return EEH_Class_Tools::has_property($this, '_existing_admin_settings') ? $this->_existing_admin_settings : null;
216 218
 	}
@@ -265,8 +267,10 @@  discard block
 block discarded – undo
265 267
 			$page = $page . '_' . $action;
266 268
 		}
267 269
 
268
-		if ( !isset( $this->admin_registered_pages[$page]) )
269
-			return false; //todo: a place to throw an exception?  We need to indicate there is no registered page so this function is not being called correctly.
270
+		if ( !isset( $this->admin_registered_pages[$page]) ) {
271
+					return false;
272
+		}
273
+		//todo: a place to throw an exception?  We need to indicate there is no registered page so this function is not being called correctly.
270 274
 
271 275
 		//k made it here so let's call the method
272 276
 		if ( FALSE === ( $content = call_user_func_array( array( $this, '_get_admin_content_' . $page), array($actives, $extra) ) ) ) {
Please login to merge, or discard this patch.
core/libraries/messages/EE_Payment_Base_message_type.lib.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -39,31 +39,31 @@  discard block
 block discarded – undo
39 39
 
40 40
 
41 41
 
42
-	protected function _get_data_for_context( $context, EE_Registration $registration, $id ) {
42
+	protected function _get_data_for_context($context, EE_Registration $registration, $id) {
43 43
 
44 44
 		//use the registration to get the transaction.
45 45
 		$transaction = $registration->transaction();
46 46
 
47 47
 		//bail early if no transaction
48
-		if ( ! $transaction instanceof EE_Transaction ) {
49
-			throw new EE_Error( __('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso' ) );
48
+		if ( ! $transaction instanceof EE_Transaction) {
49
+			throw new EE_Error(__('The given registration does not have an associated transaction. Something is wrong.', 'event_espresso'));
50 50
 		}
51 51
 
52
-		$payment = ! empty( $id ) ? EEM_Payment::instance()->get_one( array( array( 'PAY_ID' => $id, 'TXN_ID' => $transaction->ID() ) ) ) : 0;
52
+		$payment = ! empty($id) ? EEM_Payment::instance()->get_one(array(array('PAY_ID' => $id, 'TXN_ID' => $transaction->ID()))) : 0;
53 53
 
54
-		return array( $transaction, $payment );
54
+		return array($transaction, $payment);
55 55
 	}
56 56
 
57 57
 
58 58
 
59 59
 
60 60
 
61
-	protected function _get_id_for_msg_url( $context, EE_Registration $registration ) {
61
+	protected function _get_id_for_msg_url($context, EE_Registration $registration) {
62 62
 		//there should be a transaction and payment object in the incoming data.
63
-		if ( $this->_data instanceof EE_Messages_incoming_data  ) {
64
-			$payment = !empty( $this->_data->payment ) ? $this->_data->payment : NULL;
63
+		if ($this->_data instanceof EE_Messages_incoming_data) {
64
+			$payment = ! empty($this->_data->payment) ? $this->_data->payment : NULL;
65 65
 
66
-			if ( $payment instanceof EE_Payment ) {
66
+			if ($payment instanceof EE_Payment) {
67 67
 				return $payment->ID();
68 68
 			}
69 69
 		}
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
 
73 73
 
74 74
 
75
-	protected function _get_admin_content_events_edit_for_messenger( EE_Messenger $messenger ) {
75
+	protected function _get_admin_content_events_edit_for_messenger(EE_Messenger $messenger) {
76 76
 		//this is just a test
77
-		return $this->name . ' Message Type for ' . $messenger->name . ' Messenger ';
77
+		return $this->name.' Message Type for '.$messenger->name.' Messenger ';
78 78
 	}
79 79
 
80 80
 	/**
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,9 @@
 block discarded – undo
6 6
  * @subpackage messages
7 7
  * @since           4.5.0
8 8
  */
9
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
9
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
10
+	exit('No direct script access allowed');
11
+}
10 12
 
11 13
 /**
12 14
  * This class contains common methods/properties shared among all payment message types.
Please login to merge, or discard this patch.