Completed
Branch BUG-9811-trim-form-input-value... (96191a)
by
unknown
194:11 queued 179:40
created
strategies/validation/EE_Email_Validation_Strategy.strategy.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     * just checks the field isn't blank
27 27
     *
28 28
     * @param $normalized_value
29
-    * @return bool
29
+    * @return boolean|null
30 30
     * @throws \EE_Validation_Error
31 31
     */
32 32
 	function validate($normalized_value) {
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 class EE_Email_Validation_Strategy extends EE_Text_Validation_Strategy{
12 12
 
13 13
 	/**
14
-     * @param null $validation_error_message
15
-     */
14
+	 * @param null $validation_error_message
15
+	 */
16 16
    public function __construct( $validation_error_message = NULL ) {
17 17
 	   if( ! $validation_error_message ){
18 18
 			$validation_error_message = __("Please enter a valid email address.", "event_espresso");
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 
39 39
 
40 40
 	/**
41
-     * @return array
42
-     */
41
+	 * @return array
42
+	 */
43 43
    function get_jquery_validation_rule_array(){
44 44
 	   return array( 'email'=>true, 'messages' => array( 'email' => $this->get_validation_error_message() ) );
45 45
 	}
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 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_Email_Validation_Strategy extends EE_Text_Validation_Strategy{
11
+class EE_Email_Validation_Strategy extends EE_Text_Validation_Strategy {
12 12
 
13 13
 	/**
14 14
      * @param null $validation_error_message
15 15
      */
16
-   public function __construct( $validation_error_message = NULL ) {
17
-	   if( ! $validation_error_message ){
16
+   public function __construct($validation_error_message = NULL) {
17
+	   if ( ! $validation_error_message) {
18 18
 			$validation_error_message = __("Please enter a valid email address.", "event_espresso");
19 19
 		}
20
-		parent::__construct( $validation_error_message );
20
+		parent::__construct($validation_error_message);
21 21
 	}
22 22
 
23 23
 
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
     * @return bool
30 30
     * @throws \EE_Validation_Error
31 31
     */
32
-	public function validate( $normalized_value ) {
33
-		if( $normalized_value && ! $this->_validate_email( $normalized_value ) ){
34
-			throw new EE_Validation_Error( $this->get_validation_error_message(), 'required');
32
+	public function validate($normalized_value) {
33
+		if ($normalized_value && ! $this->_validate_email($normalized_value)) {
34
+			throw new EE_Validation_Error($this->get_validation_error_message(), 'required');
35 35
 		}
36 36
 	}
37 37
 
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 	/**
41 41
      * @return array
42 42
      */
43
-	public function get_jquery_validation_rule_array(){
44
-	   return array( 'email'=>true, 'messages' => array( 'email' => $this->get_validation_error_message() ) );
43
+	public function get_jquery_validation_rule_array() {
44
+	   return array('email'=>true, 'messages' => array('email' => $this->get_validation_error_message()));
45 45
 	}
46 46
 
47 47
 
@@ -54,38 +54,38 @@  discard block
 block discarded – undo
54 54
 	 * @return bool of whether the email is valid or not
55 55
 	 * @throws \EE_Validation_Error
56 56
 	 */
57
-	private function _validate_email( $email ) {
58
-		$validation_level = isset( EE_Registry::instance()->CFG->registration->email_validation_level )
57
+	private function _validate_email($email) {
58
+		$validation_level = isset(EE_Registry::instance()->CFG->registration->email_validation_level)
59 59
 			? EE_Registry::instance()->CFG->registration->email_validation_level
60 60
 			: 'wp_default';
61
-		if ( ! preg_match( '/^.+\@\S+$/', $email ) ) { // \.\S+
61
+		if ( ! preg_match('/^.+\@\S+$/', $email)) { // \.\S+
62 62
 			// email not in correct {string}@{string} format
63 63
 			return false;
64 64
 		} else {
65
-			$atIndex = strrpos( $email, "@" );
66
-			$domain = substr( $email, $atIndex + 1 );
67
-			$local = substr( $email, 0, $atIndex );
68
-			$localLen = strlen( $local );
69
-			$domainLen = strlen( $domain );
70
-			if ( $localLen < 1 || $localLen > 64 ) {
65
+			$atIndex = strrpos($email, "@");
66
+			$domain = substr($email, $atIndex + 1);
67
+			$local = substr($email, 0, $atIndex);
68
+			$localLen = strlen($local);
69
+			$domainLen = strlen($domain);
70
+			if ($localLen < 1 || $localLen > 64) {
71 71
 				// local part length exceeded
72 72
 				return false;
73
-			} else if ( $domainLen < 1 || $domainLen > 255 ) {
73
+			} else if ($domainLen < 1 || $domainLen > 255) {
74 74
 				// domain part length exceeded
75 75
 				return false;
76
-			} else if ( $local[ 0 ] === '.' || $local[ $localLen - 1 ] === '.' ) {
76
+			} else if ($local[0] === '.' || $local[$localLen - 1] === '.') {
77 77
 				// local part starts or ends with '.'
78 78
 				return false;
79
-			} else if ( preg_match( '/\\.\\./', $local ) ) {
79
+			} else if (preg_match('/\\.\\./', $local)) {
80 80
 				// local part has two consecutive dots
81 81
 				return false;
82
-			} else if ( preg_match( '/\\.\\./', $domain ) ) {
82
+			} else if (preg_match('/\\.\\./', $domain)) {
83 83
 				// domain part has two consecutive dots
84 84
 				return false;
85
-			} else if ( $validation_level === 'wp_default' ) {
86
-				return is_email( $email );
85
+			} else if ($validation_level === 'wp_default') {
86
+				return is_email($email);
87 87
 			} else if (
88
-				( $validation_level === 'i18n' || $validation_level === 'i18n_dns' )
88
+				($validation_level === 'i18n' || $validation_level === 'i18n_dns')
89 89
 				// plz see http://stackoverflow.com/a/24817336 re: the following regex
90 90
 				&& ! preg_match(
91 91
 					'/^(?!\.)((?!.*\.{2})[a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\.!#$%&\'*+-\/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\-\.\d]+)((\.([a-zA-Z\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}]){2,63})+)$/u',
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 			) {
95 95
 				return false;
96 96
 			}
97
-			if ( $validation_level === 'i18n_dns' ) {
98
-				if ( ! checkdnsrr( $domain, "MX" ) ) {
97
+			if ($validation_level === 'i18n_dns') {
98
+				if ( ! checkdnsrr($domain, "MX")) {
99 99
 					// domain not found in MX records
100 100
 					throw new EE_Validation_Error(
101 101
 						__(
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 							'event_espresso'
104 104
 						)
105 105
 					);
106
-				} else if ( ! checkdnsrr( $domain, "A" ) ) {
106
+				} else if ( ! checkdnsrr($domain, "A")) {
107 107
 					// domain not found in A records
108 108
 					throw new EE_Validation_Error(
109 109
 						__(
Please login to merge, or discard this patch.
strategies/validation/EE_Many_Valued_Validation_Strategy.strategy.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 	/**
28 28
 	 * Applies all teh individual item validation strategies on each item in the array
29 29
 	 * @param array $normalized_value
30
-	 * @return boolean
30
+	 * @return boolean|null
31 31
 	 */
32 32
 	function validate($normalized_value) {
33 33
 		if( is_array($normalized_value)){
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
  * @since 				4.6
12 12
  *
13 13
  */
14
-class EE_Many_Valued_Validation_Strategy extends EE_Validation_Strategy_Base{
14
+class EE_Many_Valued_Validation_Strategy extends EE_Validation_Strategy_Base {
15 15
 	protected $_individual_item_validation_strategies = array();
16 16
 	/**
17 17
 	 *
18 18
 	 * @param EE_Validation_Strategy_Base[] $individual_item_validation_strategies (or a single EE_Validation_Strategy_Base)
19 19
 	 */
20 20
 	public function __construct($individual_item_validation_strategies) {
21
-		if( ! is_array($individual_item_validation_strategies)){
21
+		if ( ! is_array($individual_item_validation_strategies)) {
22 22
 			$individual_item_validation_strategies = array($individual_item_validation_strategies);
23 23
 		}
24 24
 		$this->_individual_item_validation_strategies = $individual_item_validation_strategies;
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 	 * @return boolean
31 31
 	 */
32 32
 	function validate($normalized_value) {
33
-		if( is_array($normalized_value)){
33
+		if (is_array($normalized_value)) {
34 34
 			$items_to_validate = $normalized_value;
35
-		}else{
35
+		} else {
36 36
 			$items_to_validate = array($normalized_value);
37 37
 		}
38
-		foreach($items_to_validate as $individual_item){
39
-			foreach($this->_individual_item_validation_strategies as $validation_strategy){
40
-				if ( $validation_strategy instanceof EE_Validation_Strategy_Base ) {
38
+		foreach ($items_to_validate as $individual_item) {
39
+			foreach ($this->_individual_item_validation_strategies as $validation_strategy) {
40
+				if ($validation_strategy instanceof EE_Validation_Strategy_Base) {
41 41
 					$validation_strategy->validate($individual_item);
42 42
 				}
43 43
 			}
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	 */
51 51
 	function _construct_finalize(\EE_Form_Input_Base $form_input) {
52 52
 		parent::_construct_finalize($form_input);
53
-		foreach($this->_individual_item_validation_strategies as $item_validation_strategy){
54
-			if ( $item_validation_strategy instanceof EE_Validation_Strategy_Base ) {
53
+		foreach ($this->_individual_item_validation_strategies as $item_validation_strategy) {
54
+			if ($item_validation_strategy instanceof EE_Validation_Strategy_Base) {
55 55
 				$item_validation_strategy->_construct_finalize($form_input);
56 56
 			}
57 57
 		}
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
 		//so in case teh IPN is arriving later, let's try to process an IPN!
91 91
 		if($_SERVER['REQUEST_METHOD'] == 'POST'){
92 92
 			return $this->handle_ipn($_POST, $transaction );
93
-		}else{
93
+		} else{
94 94
 			return parent::finalize_payment_for( $transaction );
95 95
 		}
96 96
 	}
Please login to merge, or discard this patch.
form_sections/strategies/validation/EE_URL_Validation_Strategy.strategy.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 	 * just checks the field isn't blank
27 27
 	 *
28 28
 	 * @param $normalized_value
29
-	 * @return bool
29
+	 * @return boolean|null
30 30
 	 * @throws \EE_Validation_Error
31 31
 	 */
32 32
 	function validate($normalized_value) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
 		if( $normalized_value ){
34 34
 			if (filter_var($normalized_value, FILTER_VALIDATE_URL) === false){
35 35
 				throw new EE_Validation_Error( $this->get_validation_error_message(), 'invalid_url');
36
-			}else{
36
+			} else{
37 37
 				EE_Registry::instance()->load_helper('URL');
38 38
 				if( ! EEH_URL::remote_file_exists(
39 39
 						$normalized_value,
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -8,16 +8,16 @@  discard block
 block discarded – undo
8 8
  * @since 				4.6
9 9
  *
10 10
  */
11
-class EE_URL_Validation_Strategy extends EE_Validation_Strategy_Base{
11
+class EE_URL_Validation_Strategy extends EE_Validation_Strategy_Base {
12 12
 
13 13
 	/**
14 14
 	 * @param null $validation_error_message
15 15
 	 */
16
-	public function __construct( $validation_error_message = NULL ) {
17
-		if( ! $validation_error_message ){
16
+	public function __construct($validation_error_message = NULL) {
17
+		if ( ! $validation_error_message) {
18 18
 			$validation_error_message = __("Please enter a valid URL", "event_espresso");
19 19
 		}
20
-		parent::__construct( $validation_error_message );
20
+		parent::__construct($validation_error_message);
21 21
 	}
22 22
 
23 23
 
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 	 * @throws \EE_Validation_Error
31 31
 	 */
32 32
 	function validate($normalized_value) {
33
-		if( $normalized_value ){
34
-			if (filter_var($normalized_value, FILTER_VALIDATE_URL) === false){
35
-				throw new EE_Validation_Error( $this->get_validation_error_message(), 'invalid_url');
36
-			}else{
37
-				if( ! EEH_URL::remote_file_exists(
33
+		if ($normalized_value) {
34
+			if (filter_var($normalized_value, FILTER_VALIDATE_URL) === false) {
35
+				throw new EE_Validation_Error($this->get_validation_error_message(), 'invalid_url');
36
+			} else {
37
+				if ( ! EEH_URL::remote_file_exists(
38 38
 						$normalized_value,
39 39
 						array(
40 40
 							'sslverify' => false, 
41
-							'limit_response_size' => 4095,//we don't really care for a full response, but we do want headers at least. Lets just ask for a one block
42
-						))){
41
+							'limit_response_size' => 4095, //we don't really care for a full response, but we do want headers at least. Lets just ask for a one block
42
+						))) {
43 43
 					throw new EE_Validation_Error(sprintf(__("That URL seems to be broken. Please enter a valid URL", "event_espresso")));
44 44
 				}
45 45
 			}
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 	/**
52 52
 	 * @return array
53 53
 	 */
54
-	function get_jquery_validation_rule_array(){
55
-		return array( 'validUrl'=>true, 'messages' => array( 'validUrl' => $this->get_validation_error_message() ) );
54
+	function get_jquery_validation_rule_array() {
55
+		return array('validUrl'=>true, 'messages' => array('validUrl' => $this->get_validation_error_message()));
56 56
 	}
57 57
 }
58 58
 
Please login to merge, or discard this patch.
line_item_display/EE_Default_Line_Item_Display_Strategy.strategy.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	/**
56 56
 	 * @param EE_Line_Item $line_item
57 57
 	 * @param array        $options
58
-	 * @return mixed
58
+	 * @return string
59 59
 	 */
60 60
 	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
61 61
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 	 *
136 136
 	 * @param EE_Line_Item $line_item
137 137
 	 * @param array        $options
138
-	 * @return mixed
138
+	 * @return string
139 139
 	 */
140 140
 	private function _item_row( EE_Line_Item $line_item, $options = array() ) {
141 141
 		// start of row
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	 *
179 179
 	 * @param EE_Line_Item $line_item
180 180
 	 * @param array        $options
181
-	 * @return mixed
181
+	 * @return string
182 182
 	 */
183 183
 	private function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
184 184
 		// start of row
Please login to merge, or discard this patch.
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_Default_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_Default_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_Default_Line_Item_Display_Strategy implements EEI_Line_Item_Display {
16 16
 
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -57,29 +57,29 @@  discard block
 block discarded – undo
57 57
 	 * @param array        $options
58 58
 	 * @return mixed
59 59
 	 */
60
-	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
60
+	public function display_line_item(EE_Line_Item $line_item, $options = array()) {
61 61
 
62 62
 		$html = '';
63 63
 		// set some default options and merge with incoming
64 64
 		$default_options = array(
65
-			'show_desc' => TRUE,  // 	TRUE 		FALSE
65
+			'show_desc' => TRUE, // 	TRUE 		FALSE
66 66
 			'odd' => FALSE
67 67
 		);
68
-		$options = array_merge( $default_options, (array)$options );
68
+		$options = array_merge($default_options, (array) $options);
69 69
 
70
-		switch( $line_item->type() ) {
70
+		switch ($line_item->type()) {
71 71
 
72 72
 			case EEM_Line_Item::type_line_item:
73 73
 				// item row
74
-				$html .= $this->_item_row( $line_item, $options );
74
+				$html .= $this->_item_row($line_item, $options);
75 75
 				// got any kids?
76
-				foreach ( $line_item->children() as $child_line_item ) {
77
-					$this->display_line_item( $child_line_item, $options );
76
+				foreach ($line_item->children() as $child_line_item) {
77
+					$this->display_line_item($child_line_item, $options);
78 78
 				}
79 79
 				break;
80 80
 
81 81
 			case EEM_Line_Item::type_sub_line_item:
82
-				$html .= $this->_sub_item_row( $line_item, $options );
82
+				$html .= $this->_sub_item_row($line_item, $options);
83 83
 				break;
84 84
 
85 85
 			case EEM_Line_Item::type_sub_total:
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
 				break;
91 91
 
92 92
 			case EEM_Line_Item::type_tax_sub_total:
93
-				foreach ( $line_item->children() as $child_line_item ) {
94
-					if ( $child_line_item->type() == EEM_Line_Item::type_tax ) {
93
+				foreach ($line_item->children() as $child_line_item) {
94
+					if ($child_line_item->type() == EEM_Line_Item::type_tax) {
95 95
 						// recursively feed children back into this method
96
-						$this->display_line_item( $child_line_item, $options );
96
+						$this->display_line_item($child_line_item, $options);
97 97
 					}
98 98
 				}
99 99
 				break;
@@ -101,20 +101,20 @@  discard block
 block discarded – undo
101 101
 			case EEM_Line_Item::type_total:
102 102
 				// get all child line items
103 103
 				$children = $line_item->children();
104
-				if ( $options[ 'set_tax_rate' ] === true  ) {
104
+				if ($options['set_tax_rate'] === true) {
105 105
 					// loop thru tax child line items just to determine tax rate
106
-					foreach ( $children as $child_line_item ) {
107
-						if ( $child_line_item->type() == EEM_Line_Item::type_tax_sub_total ) {
106
+					foreach ($children as $child_line_item) {
107
+						if ($child_line_item->type() == EEM_Line_Item::type_tax_sub_total) {
108 108
 							// recursively feed children back into this method
109
-							$this->display_line_item( $child_line_item, $options );
109
+							$this->display_line_item($child_line_item, $options);
110 110
 						}
111 111
 					}
112 112
 				} else {
113 113
 					// now loop thru all non-tax child line items
114
-					foreach ( $children as $child_line_item ) {
115
-						if ( $child_line_item->type() != EEM_Line_Item::type_tax_sub_total ) {
114
+					foreach ($children as $child_line_item) {
115
+						if ($child_line_item->type() != EEM_Line_Item::type_tax_sub_total) {
116 116
 							// recursively feed children back into this method
117
-							$html .= $this->display_line_item( $child_line_item, $options );
117
+							$html .= $this->display_line_item($child_line_item, $options);
118 118
 						}
119 119
 					}
120 120
 				}
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
 	 * @param array        $options
135 135
 	 * @return mixed
136 136
 	 */
137
-	private function _item_row( EE_Line_Item $line_item, $options = array() ) {
137
+	private function _item_row(EE_Line_Item $line_item, $options = array()) {
138 138
 		// start of row
139 139
 		$row_class = $options['odd'] ? 'item odd' : 'item';
140
-		$html = EEH_HTML::tr( '', '', $row_class );
140
+		$html = EEH_HTML::tr('', '', $row_class);
141 141
 		// name && desc
142 142
 		$name_and_desc = apply_filters(
143 143
 			'FHEE__EE_Default_Line_Item_Display_Strategy__item_row__name',
@@ -146,22 +146,22 @@  discard block
 block discarded – undo
146 146
 		);
147 147
 		$name_and_desc .= apply_filters(
148 148
 			'FHEE__EE_Default_Line_Item_Display_Strategy__item_row__desc',
149
-			( $options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '' ),
149
+			($options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: '.$line_item->desc().'</span>' : ''),
150 150
 			$line_item,
151 151
 			$options
152 152
 		);
153
-		$name_and_desc .= $line_item->is_taxable() ? '<span class="smaller-text lt-grey-text" style="margin:0 0 0 2em;">' . __( ' * taxable item', 'event_espresso' ) . '</span>' : '';
153
+		$name_and_desc .= $line_item->is_taxable() ? '<span class="smaller-text lt-grey-text" style="margin:0 0 0 2em;">'.__(' * taxable item', 'event_espresso').'</span>' : '';
154 154
 		// name td
155
-		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '',  'item_l' );
155
+		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '', 'item_l' );
156 156
 		// quantity td
157
-		$html .= EEH_HTML::td( $line_item->quantity(), '',  'item_l jst-rght' );
158
-		$tax_rate = $line_item->is_taxable() ? 1 + ( $this->_tax_rate / 100 ) : 1;
157
+		$html .= EEH_HTML::td($line_item->quantity(), '', 'item_l jst-rght');
158
+		$tax_rate = $line_item->is_taxable() ? 1 + ($this->_tax_rate / 100) : 1;
159 159
 		// price td
160
-		$unit_price = EEH_Template::format_currency( $line_item->unit_price() * $tax_rate, false, false );
161
-		$html .= EEH_HTML::td( $unit_price, '',  'item_c jst-rght' );
160
+		$unit_price = EEH_Template::format_currency($line_item->unit_price() * $tax_rate, false, false);
161
+		$html .= EEH_HTML::td($unit_price, '', 'item_c jst-rght');
162 162
 		// total td
163
-		$total = EEH_Template::format_currency( $line_item->unit_price() * $line_item->quantity() * $tax_rate, false, false );
164
-		$html .= EEH_HTML::td( $total, '',  'item_r jst-rght' );
163
+		$total = EEH_Template::format_currency($line_item->unit_price() * $line_item->quantity() * $tax_rate, false, false);
164
+		$html .= EEH_HTML::td($total, '', 'item_r jst-rght');
165 165
 		// end of row
166 166
 		$html .= EEH_HTML::trx();
167 167
 
@@ -177,22 +177,22 @@  discard block
 block discarded – undo
177 177
 	 * @param array        $options
178 178
 	 * @return mixed
179 179
 	 */
180
-	private function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
180
+	private function _sub_item_row(EE_Line_Item $line_item, $options = array()) {
181 181
 		// start of row
182
-		$html = EEH_HTML::tr( '', 'item sub-item-row' );
182
+		$html = EEH_HTML::tr('', 'item sub-item-row');
183 183
 		// name && desc
184 184
 		$name_and_desc = $line_item->name();
185
-		$name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '';
185
+		$name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: '.$line_item->desc().'</span>' : '';
186 186
 		// name td
187
-		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '',  'item_l sub-item' );
187
+		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '', 'item_l sub-item' );
188 188
 		// discount/surcharge td
189
-		if ( $line_item->is_percent() ) {
190
-			$html .= EEH_HTML::td( $line_item->percent() . '%', '',  'item_c' );
189
+		if ($line_item->is_percent()) {
190
+			$html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c');
191 191
 		} else {
192
-			$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '',  'item_c jst-rght' );
192
+			$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
193 193
 		}
194 194
 		// total td
195
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'item_r jst-rght' );
195
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'item_r jst-rght');
196 196
 		// end of row
197 197
 		$html .= EEH_HTML::trx();
198 198
 		return $html;
Please login to merge, or discard this patch.
line_item_display/EE_Invoice_Line_Item_Display_Strategy.strategy.php 3 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	/**
17 17
 	 * @param EE_Line_Item $line_item
18 18
 	 * @param array        $options
19
-	 * @return mixed
19
+	 * @return string
20 20
 	 */
21 21
 	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
22 22
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 *
95 95
 	 * @param EE_Line_Item $line_item
96 96
 	 * @param array        $options
97
-	 * @return mixed
97
+	 * @return string
98 98
 	 */
99 99
 	private function _item_row( EE_Line_Item $line_item, $options = array() ) {
100 100
 		// start of row
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 *
124 124
 	 * @param EE_Line_Item $line_item
125 125
 	 * @param array        $options
126
-	 * @return mixed
126
+	 * @return string
127 127
 	 */
128 128
 	private function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
129 129
 		// start of row
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 *
154 154
 	 * @param EE_Line_Item $line_item
155 155
 	 * @param array        $options
156
-	 * @return mixed
156
+	 * @return string
157 157
 	 */
158 158
 	private function _tax_row( EE_Line_Item $line_item, $options = array() ) {
159 159
 		// start of row
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 * @param EE_Line_Item $line_item
180 180
 	 * @param string       $text
181 181
 	 * @param array        $options
182
-	 * @return mixed
182
+	 * @return string
183 183
 	 */
184 184
 	private function _total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
185 185
 		// colspan
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 	 * 	_separator_row
204 204
 	 *
205 205
 	 * @param array        $options
206
-	 * @return mixed
206
+	 * @return string
207 207
 	 */
208 208
 	private function _separator_row( $options = array() ) {
209 209
 		// colspan
Please login to merge, or discard this patch.
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_Invoice_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_Invoice_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
 class EE_Invoice_Line_Item_Display_Strategy implements EEI_Line_Item_Display {
15 15
 
16 16
 	/**
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * @param array        $options
19 19
 	 * @return mixed
20 20
 	 */
21
-	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
21
+	public function display_line_item(EE_Line_Item $line_item, $options = array()) {
22 22
 
23 23
 		$html = '';
24 24
 		// set some default options and merge with incoming
@@ -26,58 +26,58 @@  discard block
 block discarded – undo
26 26
 			'show_desc' => TRUE,
27 27
 			'odd' => FALSE
28 28
 		);
29
-		$options = array_merge( $default_options, (array)$options );
29
+		$options = array_merge($default_options, (array) $options);
30 30
 
31
-		switch( $line_item->type() ) {
31
+		switch ($line_item->type()) {
32 32
 
33 33
 			case EEM_Line_Item::type_total:
34 34
 				// loop thru children
35
-				foreach( $line_item->children() as $child_line_item ) {
35
+				foreach ($line_item->children() as $child_line_item) {
36 36
 					// recursively feed children back into this method
37
-					$html .= $this->display_line_item( $child_line_item, $options );
37
+					$html .= $this->display_line_item($child_line_item, $options);
38 38
 				}
39
-				$html .= $this->_separator_row( $options );
40
-				$html .= $this->_total_row( $line_item, __('Total', 'event_espresso'), $options );
39
+				$html .= $this->_separator_row($options);
40
+				$html .= $this->_total_row($line_item, __('Total', 'event_espresso'), $options);
41 41
 				 break;
42 42
 
43 43
 
44 44
 			case EEM_Line_Item::type_sub_total:
45 45
 				// loop thru children
46
-				foreach( $line_item->children() as $child_line_item ) {
46
+				foreach ($line_item->children() as $child_line_item) {
47 47
 					// recursively feed children back into this method
48
-					$html .= $this->display_line_item( $child_line_item, $options );
48
+					$html .= $this->display_line_item($child_line_item, $options);
49 49
 				}
50
-				$html .= $this->_total_row( $line_item, __('Sub-Total', 'event_espresso'), $options );
50
+				$html .= $this->_total_row($line_item, __('Sub-Total', 'event_espresso'), $options);
51 51
 				break;
52 52
 
53 53
 
54 54
 			case EEM_Line_Item::type_tax_sub_total:
55 55
 				// loop thru children
56
-				foreach( $line_item->children() as $child_line_item ) {
56
+				foreach ($line_item->children() 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
-				$html .= $this->_total_row( $line_item, __('Tax Total', 'event_espresso'), $options );
60
+				$html .= $this->_total_row($line_item, __('Tax Total', 'event_espresso'), $options);
61 61
 				break;
62 62
 
63 63
 
64 64
 			case EEM_Line_Item::type_line_item:
65 65
 				// item row
66
-				$html .= $this->_item_row( $line_item, $options );
66
+				$html .= $this->_item_row($line_item, $options);
67 67
 				// got any kids?
68
-				foreach( $line_item->children() as $child_line_item ) {
69
-					$this->display_line_item( $child_line_item, $options );
68
+				foreach ($line_item->children() as $child_line_item) {
69
+					$this->display_line_item($child_line_item, $options);
70 70
 				}
71 71
 				break;
72 72
 
73 73
 
74 74
 			case EEM_Line_Item::type_sub_line_item:
75
-				$html .= $this->_sub_item_row( $line_item, $options );
75
+				$html .= $this->_sub_item_row($line_item, $options);
76 76
 				break;
77 77
 
78 78
 
79 79
 			case EEM_Line_Item::type_tax:
80
-				$html .= $this->_tax_row( $line_item, $options );
80
+				$html .= $this->_tax_row($line_item, $options);
81 81
 				break;
82 82
 
83 83
 		}
@@ -94,21 +94,21 @@  discard block
 block discarded – undo
94 94
 	 * @param array        $options
95 95
 	 * @return mixed
96 96
 	 */
97
-	private function _item_row( EE_Line_Item $line_item, $options = array() ) {
97
+	private function _item_row(EE_Line_Item $line_item, $options = array()) {
98 98
 		// start of row
99 99
 		$row_class = $options['odd'] ? 'item odd' : 'item';
100
-		$html = EEH_HTML::tr( '', $row_class );
100
+		$html = EEH_HTML::tr('', $row_class);
101 101
 		// name td
102
-		$html .= EEH_HTML::td( $line_item->name(), '',  'item_l' );
102
+		$html .= EEH_HTML::td($line_item->name(), '', 'item_l');
103 103
 		// desc td
104
-		$html .= $options['show_desc'] ? EEH_HTML::td( $line_item->desc(), '',  'item_l' ) : '';
104
+		$html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : '';
105 105
 		// quantity td
106
-		$html .= EEH_HTML::td( $line_item->quantity(), '',  'item_l' );
106
+		$html .= EEH_HTML::td($line_item->quantity(), '', 'item_l');
107 107
 		// price td
108
-		$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '',  'item_c' );
108
+		$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c');
109 109
 		// total td
110
-		$total = $line_item->is_taxable() ? $line_item->total_no_code() . '*' : $line_item->total_no_code();
111
-		$html .= EEH_HTML::td( $total, '',  'item_r' );
110
+		$total = $line_item->is_taxable() ? $line_item->total_no_code().'*' : $line_item->total_no_code();
111
+		$html .= EEH_HTML::td($total, '', 'item_r');
112 112
 		// end of row
113 113
 		$html .= EEH_HTML::trx();
114 114
 		return $html;
@@ -123,22 +123,22 @@  discard block
 block discarded – undo
123 123
 	 * @param array        $options
124 124
 	 * @return mixed
125 125
 	 */
126
-	private function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
126
+	private function _sub_item_row(EE_Line_Item $line_item, $options = array()) {
127 127
 		// start of row
128
-		$html = EEH_HTML::tr( '', 'item sub-item-row' );
128
+		$html = EEH_HTML::tr('', 'item sub-item-row');
129 129
 		// name td
130
-		$html .= EEH_HTML::td( $line_item->name(), '',  'item_l sub-item' );
130
+		$html .= EEH_HTML::td($line_item->name(), '', 'item_l sub-item');
131 131
 		// desc td
132
-		$html .= $options['show_desc'] ? EEH_HTML::td( $line_item->desc(), '',  'item_l' ) : '';
133
-		$html .= EEH_HTML::td() . EEH_HTML::tdx();
132
+		$html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : '';
133
+		$html .= EEH_HTML::td().EEH_HTML::tdx();
134 134
 		// discount/surcharge td
135
-		if ( $line_item->is_percent() ) {
136
-			$html .= EEH_HTML::td( $line_item->percent() . '%', '',  'item_c' );
135
+		if ($line_item->is_percent()) {
136
+			$html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c');
137 137
 		} else {
138
-			$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '',  'item_c' );
138
+			$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c');
139 139
 		}
140 140
 		// total td
141
-		$html .= EEH_HTML::td( $line_item->total_no_code(), '',  'item_r' );
141
+		$html .= EEH_HTML::td($line_item->total_no_code(), '', 'item_r');
142 142
 		// end of row
143 143
 		$html .= EEH_HTML::trx();
144 144
 		return $html;
@@ -153,17 +153,17 @@  discard block
 block discarded – undo
153 153
 	 * @param array        $options
154 154
 	 * @return mixed
155 155
 	 */
156
-	private function _tax_row( EE_Line_Item $line_item, $options = array() ) {
156
+	private function _tax_row(EE_Line_Item $line_item, $options = array()) {
157 157
 		// start of row
158
-		$html = EEH_HTML::tr( '', 'item sub-item tax-total' );
158
+		$html = EEH_HTML::tr('', 'item sub-item tax-total');
159 159
 		// name td
160
-		$html .= EEH_HTML::td( $line_item->name(), '',  'item_l sub-item' );
160
+		$html .= EEH_HTML::td($line_item->name(), '', 'item_l sub-item');
161 161
 		// desc td
162
-		$html .= $options['show_desc'] ? EEH_HTML::td( $line_item->desc(), '',  'item_l' ) : '';
162
+		$html .= $options['show_desc'] ? EEH_HTML::td($line_item->desc(), '', 'item_l') : '';
163 163
 		// percent td
164
-		$html .= EEH_HTML::td( $line_item->percent() . '%', '',  'item_c', '', ' colspan="2"' );
164
+		$html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c', '', ' colspan="2"');
165 165
 		// total td
166
-		$html .= EEH_HTML::td( $line_item->total_no_code(), '',  'item_r' );
166
+		$html .= EEH_HTML::td($line_item->total_no_code(), '', 'item_r');
167 167
 		// end of row
168 168
 		$html .= EEH_HTML::trx();
169 169
 		return $html;
@@ -179,17 +179,17 @@  discard block
 block discarded – undo
179 179
 	 * @param array        $options
180 180
 	 * @return mixed
181 181
 	 */
182
-	private function _total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
182
+	private function _total_row(EE_Line_Item $line_item, $text = '', $options = array()) {
183 183
 		// colspan
184 184
 		$colspan = $options['show_desc'] ? ' colspan="2"' : '';
185 185
 		// start of row
186
-		$html = EEH_HTML::tr( '', '', 'total_tr odd' );
186
+		$html = EEH_HTML::tr('', '', 'total_tr odd');
187 187
 		// empty td
188
-		$html .= EEH_HTML::td( EEH_HTML::nbsp(), '',  '',  '',  $colspan );
188
+		$html .= EEH_HTML::td(EEH_HTML::nbsp(), '', '', '', $colspan);
189 189
 		// total td
190
-		$html .= EEH_HTML::td( $text, '',  'total_currency total',  '',  $colspan );
190
+		$html .= EEH_HTML::td($text, '', 'total_currency total', '', $colspan);
191 191
 		// total td
192
-		$html .= EEH_HTML::td( $line_item->total_no_code(), '',  'total' );
192
+		$html .= EEH_HTML::td($line_item->total_no_code(), '', 'total');
193 193
 		// end of row
194 194
 		$html .= EEH_HTML::trx();
195 195
 		return $html;
@@ -203,11 +203,11 @@  discard block
 block discarded – undo
203 203
 	 * @param array        $options
204 204
 	 * @return mixed
205 205
 	 */
206
-	private function _separator_row( $options = array() ) {
206
+	private function _separator_row($options = array()) {
207 207
 		// colspan
208 208
 		$colspan = $options['show_desc'] ? ' colspan="5"' : ' colspan="4"';
209 209
 		// start of row
210
-		$html = EEH_HTML::tr( EEH_HTML::td( '<hr>', '',  '',  '',  $colspan ));
210
+		$html = EEH_HTML::tr(EEH_HTML::td('<hr>', '', '', '', $colspan));
211 211
 //		// separator td
212 212
 //		$html .= EEH_HTML::td( '<hr>', '',  '',  '',  $colspan );
213 213
 //		// end of row
Please login to merge, or discard this patch.
line_item_display/EE_Receipt_Line_Item_Display_Strategy.strategy.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 	/**
32 32
 	 * @param EE_Line_Item $line_item
33 33
 	 * @param array        $options
34
-	 * @return mixed
34
+	 * @return string
35 35
 	 */
36 36
 	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
37 37
 
Please login to merge, or discard this patch.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,17 +14,17 @@
 block discarded – undo
14 14
  * ------------------------------------------------------------------------
15 15
  */
16 16
  /**
17
- *
18
- * Class EE_Receipt_Line_Item_Display_Strategy
19
- *
20
- * Description
21
- *
22
- * @package         Event Espresso
23
- * @subpackage    core
24
- * @author				Brent Christensen
25
- * @since		 	   $VID:$
26
- *
27
- */
17
+  *
18
+  * Class EE_Receipt_Line_Item_Display_Strategy
19
+  *
20
+  * Description
21
+  *
22
+  * @package         Event Espresso
23
+  * @subpackage    core
24
+  * @author				Brent Christensen
25
+  * @since		 	   $VID:$
26
+  *
27
+  */
28 28
 
29 29
 class EE_Receipt_Line_Item_Display_Strategy  implements EEI_Line_Item_Display {
30 30
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 	 * @param array        $options
34 34
 	 * @return mixed
35 35
 	 */
36
-	public function display_line_item( EE_Line_Item $line_item, $options = array() ) {
36
+	public function display_line_item(EE_Line_Item $line_item, $options = array()) {
37 37
 
38 38
 		$html = '';
39 39
 		// set some default options and merge with incoming
@@ -41,12 +41,12 @@  discard block
 block discarded – undo
41 41
 			'show_desc' => TRUE,
42 42
 			'odd' => FALSE
43 43
 		);
44
-		$options = array_merge( $default_options, (array)$options );
45
-		switch( $line_item->type() ) {
44
+		$options = array_merge($default_options, (array) $options);
45
+		switch ($line_item->type()) {
46 46
 
47 47
 			case EEM_Line_Item::type_total:
48 48
 				// loop thru children
49
-				foreach( $line_item->children() as $child_line_item ) {
49
+				foreach ($line_item->children() as $child_line_item) {
50 50
 					// recursively feed children back into this method
51 51
 //					$html .= $this->display_line_item( $child_line_item, $options );
52 52
 				}
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
 			case EEM_Line_Item::type_sub_total:
59 59
 				// loop thru children
60
-				foreach( $line_item->children() as $child_line_item ) {
60
+				foreach ($line_item->children() as $child_line_item) {
61 61
 					// recursively feed children back into this method
62 62
 //					$html .= $this->display_line_item( $child_line_item, $options );
63 63
 				}
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
 			case EEM_Line_Item::type_tax_sub_total:
69 69
 				// loop thru children
70
-				foreach( $line_item->children() as $child_line_item ) {
70
+				foreach ($line_item->children() as $child_line_item) {
71 71
 					// recursively feed children back into this method
72 72
 //					$html .= $this->display_line_item( $child_line_item, $options );
73 73
 				}
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 				// item row
80 80
 //				$html .= $this->_item_row( $line_item, $options );
81 81
 				// got any kids?
82
-				foreach( $line_item->children() as $child_line_item ) {
82
+				foreach ($line_item->children() as $child_line_item) {
83 83
 //					$this->display_line_item( $child_line_item, $options );
84 84
 				}
85 85
 				break;
Please login to merge, or discard this patch.
libraries/line_item_display/EE_SPCO_Line_Item_Display_Strategy.strategy.php 3 patches
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
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	 *    _event_row - basically a Heading row displayed once above each event's ticket rows
207 207
 	 *
208 208
 	 * @param EE_Line_Item $line_item
209
-	 * @return mixed
209
+	 * @return string
210 210
 	 */
211 211
 	private function _event_row( EE_Line_Item $line_item ) {
212 212
 		// start of row
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 	 *
226 226
 	 * @param EE_Line_Item $line_item
227 227
 	 * @param array        $options
228
-	 * @return mixed
228
+	 * @return string
229 229
 	 */
230 230
 	private function _ticket_row( EE_Line_Item $line_item, $options = array() ) {
231 231
 		// start of row
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 	 *
269 269
 	 * @param EE_Line_Item $line_item
270 270
 	 * @param array        $options
271
-	 * @return mixed
271
+	 * @return string
272 272
 	 */
273 273
 	private function _item_row( EE_Line_Item $line_item, $options = array() ) {
274 274
 		// 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
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	 * @param EE_Line_Item $line_item
375 375
 	 * @param string $text
376 376
 	 * @param array $options
377
-	 * @return mixed
377
+	 * @return string
378 378
 	 */
379 379
 	private function _total_tax_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
380 380
 		$html = '';
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 	 * @param EE_Line_Item $line_item
402 402
 	 * @param string       $text
403 403
 	 * @param array        $options
404
-	 * @return mixed
404
+	 * @return string
405 405
 	 */
406 406
 	private function _sub_total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
407 407
 		$html = '';
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
 	 *
427 427
 	 * @param EE_Line_Item $line_item
428 428
 	 * @param string       $text
429
-	 * @return mixed
429
+	 * @return string
430 430
 	 */
431 431
 	private function _total_row( EE_Line_Item $line_item, $text = '' ) {
432 432
 		// start of row
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 	 * 	_payments_and_amount_owing_rows
447 447
 	 *
448 448
 	 * @param EE_Line_Item $line_item
449
-	 * @return mixed
449
+	 * @return string
450 450
 	 */
451 451
 	private function _payments_and_amount_owing_rows( EE_Line_Item $line_item ) {
452 452
 		$html = '';
Please login to merge, or discard this patch.
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   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -69,101 +69,101 @@  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 74
 		$html = '';
75 75
 		// set some default options and merge with incoming
76 76
 		$default_options = array(
77
-			'show_desc' => true,  // 	true 		false
77
+			'show_desc' => true, // 	true 		false
78 78
 			'odd' => false
79 79
 		);
80
-		$options = array_merge( $default_options, (array)$options );
80
+		$options = array_merge($default_options, (array) $options);
81 81
 
82
-		switch( $line_item->type() ) {
82
+		switch ($line_item->type()) {
83 83
 
84 84
 			case EEM_Line_Item::type_line_item:
85 85
 				$this->_show_taxes = $line_item->is_taxable() ? true : $this->_show_taxes;
86
-				if ( $line_item->OBJ_type() == 'Ticket' ) {
86
+				if ($line_item->OBJ_type() == 'Ticket') {
87 87
 					// item row
88
-					$html .= $this->_ticket_row( $line_item, $options );
88
+					$html .= $this->_ticket_row($line_item, $options);
89 89
 					// got any kids?
90
-					foreach ( $line_item->children() as $child_line_item ) {
91
-						$this->display_line_item( $child_line_item, $options );
90
+					foreach ($line_item->children() as $child_line_item) {
91
+						$this->display_line_item($child_line_item, $options);
92 92
 					}
93 93
 				} else {
94 94
 					// item row
95
-					$html .= $this->_item_row( $line_item, $options );
95
+					$html .= $this->_item_row($line_item, $options);
96 96
 					// got any kids?
97
-					foreach ( $line_item->children() as $child_line_item ) {
98
-						$this->display_line_item( $child_line_item, $options );
97
+					foreach ($line_item->children() as $child_line_item) {
98
+						$this->display_line_item($child_line_item, $options);
99 99
 					}
100 100
 				}
101 101
 				break;
102 102
 
103 103
 			case EEM_Line_Item::type_sub_line_item:
104
-				$html .= $this->_sub_item_row( $line_item, $options );
104
+				$html .= $this->_sub_item_row($line_item, $options);
105 105
 				break;
106 106
 
107 107
 			case EEM_Line_Item::type_sub_total:
108 108
 				static $sub_total = 0;
109 109
 				$event_sub_total = 0;
110
-				$text = __( 'Sub-Total', 'event_espresso' );
111
-				if ( $line_item->OBJ_type() == 'Event' ) {
112
-					$options[ 'event_id' ] = $event_id = $line_item->OBJ_ID();
113
-					if ( ! isset( $this->_events[ $options[ 'event_id' ] ] ) ) {
114
-						$event = EEM_Event::instance()->get_one_by_ID( $options[ 'event_id' ] );
115
-						if ( $event instanceof EE_Event ) {
116
-							if ( $event->default_registration_status() == EEM_Registration::status_id_not_approved ) {
110
+				$text = __('Sub-Total', 'event_espresso');
111
+				if ($line_item->OBJ_type() == 'Event') {
112
+					$options['event_id'] = $event_id = $line_item->OBJ_ID();
113
+					if ( ! isset($this->_events[$options['event_id']])) {
114
+						$event = EEM_Event::instance()->get_one_by_ID($options['event_id']);
115
+						if ($event instanceof EE_Event) {
116
+							if ($event->default_registration_status() == EEM_Registration::status_id_not_approved) {
117 117
 								return '';
118 118
 							}
119 119
 						}
120
-						$this->_events[ $options[ 'event_id' ] ] = 0;
121
-						$html .= $this->_event_row( $line_item );
122
-						$text = __( 'Event Sub-Total', 'event_espresso' );
120
+						$this->_events[$options['event_id']] = 0;
121
+						$html .= $this->_event_row($line_item);
122
+						$text = __('Event Sub-Total', 'event_espresso');
123 123
 					}
124 124
 				}
125 125
 				$child_line_items = $line_item->children();
126 126
 				// loop thru children
127
-				foreach( $child_line_items as $child_line_item ) {
127
+				foreach ($child_line_items as $child_line_item) {
128 128
 					// recursively feed children back into this method
129
-					$html .= $this->display_line_item( $child_line_item, $options );
129
+					$html .= $this->display_line_item($child_line_item, $options);
130 130
 				}
131
-				$event_sub_total += isset( $options[ 'event_id' ] ) ? $this->_events[ $options[ 'event_id' ] ] : 0;
131
+				$event_sub_total += isset($options['event_id']) ? $this->_events[$options['event_id']] : 0;
132 132
 				$sub_total += $event_sub_total;
133 133
 				if (
134 134
 					(
135 135
 						// event subtotals
136 136
 						$line_item->code() != 'pre-tax-subtotal' &&
137
-						count( $child_line_items ) > 1
137
+						count($child_line_items) > 1
138 138
 					)
139 139
 					||
140 140
 					(
141 141
 						// pre-tax subtotals
142 142
 						$line_item->code() == 'pre-tax-subtotal' &&
143
-						count( $this->_events ) > 1
143
+						count($this->_events) > 1
144 144
 					)
145 145
 				) {
146 146
 					$options['sub_total'] = $line_item->OBJ_type() == 'Event' ? $event_sub_total : $sub_total;
147
-					$html .= $this->_sub_total_row( $line_item, $text, $options );
147
+					$html .= $this->_sub_total_row($line_item, $text, $options);
148 148
 				}
149 149
 				break;
150 150
 
151 151
 			case EEM_Line_Item::type_tax:
152
-				if ( $this->_show_taxes ) {
153
-					$this->_taxes_html .= $this->_tax_row( $line_item, $options );
152
+				if ($this->_show_taxes) {
153
+					$this->_taxes_html .= $this->_tax_row($line_item, $options);
154 154
 				}
155 155
 				break;
156 156
 
157 157
 			case EEM_Line_Item::type_tax_sub_total:
158
-				if ( $this->_show_taxes ) {
158
+				if ($this->_show_taxes) {
159 159
 					$child_line_items = $line_item->children();
160 160
 					// loop thru children
161
-					foreach( $child_line_items as $child_line_item ) {
161
+					foreach ($child_line_items as $child_line_item) {
162 162
 						// recursively feed children back into this method
163
-						$html .= $this->display_line_item( $child_line_item, $options );
163
+						$html .= $this->display_line_item($child_line_item, $options);
164 164
 					}
165
-					if ( count( $child_line_items ) > 1 ) {
166
-						$this->_taxes_html .= $this->_total_tax_row( $line_item, __( 'Tax Total', 'event_espresso' ) );
165
+					if (count($child_line_items) > 1) {
166
+						$this->_taxes_html .= $this->_total_tax_row($line_item, __('Tax Total', 'event_espresso'));
167 167
 					}
168 168
 				}
169 169
 				break;
@@ -172,25 +172,25 @@  discard block
 block discarded – undo
172 172
 				// get all child line items
173 173
 				$children = $line_item->children();
174 174
 				// loop thru all non-tax child line items
175
-				foreach( $children as $child_line_item ) {
176
-					if ( $child_line_item->type() != EEM_Line_Item::type_tax_sub_total ) {
175
+				foreach ($children as $child_line_item) {
176
+					if ($child_line_item->type() != EEM_Line_Item::type_tax_sub_total) {
177 177
 						// recursively feed children back into this method
178
-						$html .= $this->display_line_item( $child_line_item, $options );
178
+						$html .= $this->display_line_item($child_line_item, $options);
179 179
 					}
180 180
 				}
181 181
 
182 182
 				// now loop thru  tax child line items
183
-				foreach( $children as $child_line_item ) {
184
-					if ( $child_line_item->type() == EEM_Line_Item::type_tax_sub_total ) {
183
+				foreach ($children as $child_line_item) {
184
+					if ($child_line_item->type() == EEM_Line_Item::type_tax_sub_total) {
185 185
 						// recursively feed children back into this method
186
-						$html .= $this->display_line_item( $child_line_item, $options );
186
+						$html .= $this->display_line_item($child_line_item, $options);
187 187
 					}
188 188
 				}
189 189
 				$html .= $this->_taxes_html;
190
-				$html .= $this->_total_row( $line_item, __('Total', 'event_espresso') );
190
+				$html .= $this->_total_row($line_item, __('Total', 'event_espresso'));
191 191
 
192 192
 
193
-				$html .= $this->_payments_and_amount_owing_rows( $line_item, $options );
193
+				$html .= $this->_payments_and_amount_owing_rows($line_item, $options);
194 194
 				break;
195 195
 
196 196
 		}
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
 	 * @param EE_Line_Item $line_item
206 206
 	 * @return mixed
207 207
 	 */
208
-	private function _event_row( EE_Line_Item $line_item ) {
208
+	private function _event_row(EE_Line_Item $line_item) {
209 209
 		// start of row
210
-		$html = EEH_HTML::tr( '', 'event-cart-total-row', 'total_tr odd' );
210
+		$html = EEH_HTML::tr('', 'event-cart-total-row', 'total_tr odd');
211 211
 		// event name td
212
-		$html .= EEH_HTML::td( EEH_HTML::strong( $line_item->name() ), '', 'event-header', '', ' colspan="4"' );
212
+		$html .= EEH_HTML::td(EEH_HTML::strong($line_item->name()), '', 'event-header', '', ' colspan="4"');
213 213
 		// end of row
214 214
 		$html .= EEH_HTML::trx();
215 215
 		return $html;
@@ -224,10 +224,10 @@  discard block
 block discarded – undo
224 224
 	 * @param array        $options
225 225
 	 * @return mixed
226 226
 	 */
227
-	private function _ticket_row( EE_Line_Item $line_item, $options = array() ) {
227
+	private function _ticket_row(EE_Line_Item $line_item, $options = array()) {
228 228
 		// start of row
229 229
 		$row_class = $options['odd'] ? 'item odd' : 'item';
230
-		$html = EEH_HTML::tr( '', '', $row_class );
230
+		$html = EEH_HTML::tr('', '', $row_class);
231 231
 		// name && desc
232 232
 		$name_and_desc = apply_filters(
233 233
 			'FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__name',
@@ -236,23 +236,23 @@  discard block
 block discarded – undo
236 236
 		);
237 237
 		$name_and_desc .= apply_filters(
238 238
 			'FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__desc',
239
-			( $options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '' ),
239
+			($options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: '.$line_item->desc().'</span>' : ''),
240 240
 			$line_item,
241 241
 			$options
242 242
 		);
243 243
 		$name_and_desc .= $line_item->is_taxable() ? ' * ' : '';
244 244
 		// name td
245
-		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '',  'item_l' );
245
+		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '', 'item_l' );
246 246
 		// price td
247
-		$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '',  'item_c jst-rght' );
247
+		$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
248 248
 		// quantity td
249
-		$html .= EEH_HTML::td( $line_item->quantity(), '', 'item_l jst-rght' );
249
+		$html .= EEH_HTML::td($line_item->quantity(), '', 'item_l jst-rght');
250 250
 		$this->_total_items += $line_item->quantity();
251 251
 		// determine total for line item
252 252
 		$total = $line_item->total();
253
-		$this->_events[ $options[ 'event_id' ] ] += $total;
253
+		$this->_events[$options['event_id']] += $total;
254 254
 		// total td
255
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $total, false, false ), '',  'item_r jst-rght' );
255
+		$html .= EEH_HTML::td(EEH_Template::format_currency($total, false, false), '', 'item_r jst-rght');
256 256
 		// end of row
257 257
 		$html .= EEH_HTML::trx();
258 258
 		return $html;
@@ -267,41 +267,41 @@  discard block
 block discarded – undo
267 267
 	 * @param array        $options
268 268
 	 * @return mixed
269 269
 	 */
270
-	private function _item_row( EE_Line_Item $line_item, $options = array() ) {
270
+	private function _item_row(EE_Line_Item $line_item, $options = array()) {
271 271
 		// start of row
272 272
 		$row_class = $options['odd'] ? 'item odd' : 'item';
273
-		$html = EEH_HTML::tr( '', '', $row_class );
274
-		$obj_name = $line_item->OBJ_type() ? $line_item->OBJ_type() . ': ' : '';
273
+		$html = EEH_HTML::tr('', '', $row_class);
274
+		$obj_name = $line_item->OBJ_type() ? $line_item->OBJ_type().': ' : '';
275 275
 		// name && desc
276 276
 		$name_and_desc = apply_filters(
277 277
 			'FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__name',
278
-			 $obj_name . $line_item->name(),
278
+			 $obj_name.$line_item->name(),
279 279
 			$line_item
280 280
 		);
281 281
 		$name_and_desc .= apply_filters(
282 282
 			'FHEE__EE_SPCO_Line_Item_Display_Strategy__item_row__desc',
283
-			( $options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '' ),
283
+			($options['show_desc'] ? '<span class="line-item-desc-spn smaller-text">: '.$line_item->desc().'</span>' : ''),
284 284
 			$line_item,
285 285
 			$options
286 286
 		);
287 287
 		$name_and_desc .= $line_item->is_taxable() ? ' * ' : '';
288 288
 		// name td
289
-		$html .= EEH_HTML::td( $name_and_desc, '',  'item_l' );
289
+		$html .= EEH_HTML::td($name_and_desc, '', 'item_l');
290 290
 		// price td
291
-		if ( $line_item->is_percent() ) {
292
-			$html .= EEH_HTML::td( $line_item->percent() . '%', '', 'item_c jst-rght' );
291
+		if ($line_item->is_percent()) {
292
+			$html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c jst-rght');
293 293
 		} else {
294
-			$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '', 'item_c jst-rght' );
294
+			$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
295 295
 		}
296 296
 		// quantity td
297
-		$html .= EEH_HTML::td( $line_item->quantity(), '', 'item_l jst-rght' );
297
+		$html .= EEH_HTML::td($line_item->quantity(), '', 'item_l jst-rght');
298 298
 		//$total = $line_item->total() * $line_item->quantity();
299 299
 		$total = $line_item->total();
300
-		if( isset( $options[ 'event_id' ] ) && isset( $this->_events[ $options[ 'event_id' ] ] ) ) {
301
-			$this->_events[ $options[ 'event_id' ] ] += $total;
300
+		if (isset($options['event_id']) && isset($this->_events[$options['event_id']])) {
301
+			$this->_events[$options['event_id']] += $total;
302 302
 		}
303 303
 		// total td
304
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $total, false, false ), '',  'item_r jst-rght' );
304
+		$html .= EEH_HTML::td(EEH_Template::format_currency($total, false, false), '', 'item_r jst-rght');
305 305
 		// end of row
306 306
 		$html .= EEH_HTML::trx();
307 307
 		return $html;
@@ -316,22 +316,22 @@  discard block
 block discarded – undo
316 316
 	 * @param array        $options
317 317
 	 * @return mixed
318 318
 	 */
319
-	private function _sub_item_row( EE_Line_Item $line_item, $options = array() ) {
319
+	private function _sub_item_row(EE_Line_Item $line_item, $options = array()) {
320 320
 		// start of row
321
-		$html = EEH_HTML::tr( '', 'item sub-item-row' );
321
+		$html = EEH_HTML::tr('', 'item sub-item-row');
322 322
 		// name && desc
323 323
 		$name_and_desc = $line_item->name();
324
-		$name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: ' . $line_item->desc() . '</span>' : '';
324
+		$name_and_desc .= $options['show_desc'] ? '<span class="line-sub-item-desc-spn smaller-text">: '.$line_item->desc().'</span>' : '';
325 325
 		// name td
326
-		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '',  'item_l sub-item' );
326
+		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '', 'item_l sub-item' );
327 327
 		// discount/surcharge td
328
-		if ( $line_item->is_percent() ) {
329
-			$html .= EEH_HTML::td( $line_item->percent() . '%', '',  'item_c' );
328
+		if ($line_item->is_percent()) {
329
+			$html .= EEH_HTML::td($line_item->percent().'%', '', 'item_c');
330 330
 		} else {
331
-			$html .= EEH_HTML::td( $line_item->unit_price_no_code(), '',  'item_c jst-rght' );
331
+			$html .= EEH_HTML::td($line_item->unit_price_no_code(), '', 'item_c jst-rght');
332 332
 		}
333 333
 		// total td
334
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'item_r jst-rght' );
334
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'item_r jst-rght');
335 335
 		// end of row
336 336
 		$html .= EEH_HTML::trx();
337 337
 		return $html;
@@ -346,21 +346,21 @@  discard block
 block discarded – undo
346 346
 	 * @param array        $options
347 347
 	 * @return mixed
348 348
 	 */
349
-	private function _tax_row( EE_Line_Item $line_item, $options = array() ) {
349
+	private function _tax_row(EE_Line_Item $line_item, $options = array()) {
350 350
 		// start of row
351
-		$html = EEH_HTML::tr( '', 'item sub-item tax-total' );
351
+		$html = EEH_HTML::tr('', 'item sub-item tax-total');
352 352
 		// name && desc
353 353
 		$name_and_desc = $line_item->name();
354
-		$name_and_desc .= '<span class="smaller-text lt-grey-text" style="margin:0 0 0 2em;">' . __( ' * taxable items', 'event_espresso' ) . '</span>';
355
-		$name_and_desc .= $options[ 'show_desc' ] ? '<br/>' . $line_item->desc() : '';
354
+		$name_and_desc .= '<span class="smaller-text lt-grey-text" style="margin:0 0 0 2em;">'.__(' * taxable items', 'event_espresso').'</span>';
355
+		$name_and_desc .= $options['show_desc'] ? '<br/>'.$line_item->desc() : '';
356 356
 		// name td
357
-		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '',  'item_l sub-item' );
357
+		$html .= EEH_HTML::td( /*__FUNCTION__ .*/ $name_and_desc, '', 'item_l sub-item' );
358 358
 		// percent td
359
-		$html .= EEH_HTML::td( $line_item->percent() . '%', '',  ' jst-rght', '' );
359
+		$html .= EEH_HTML::td($line_item->percent().'%', '', ' jst-rght', '');
360 360
 		// empty td (price)
361
-		$html .= EEH_HTML::td( EEH_HTML::nbsp() );
361
+		$html .= EEH_HTML::td(EEH_HTML::nbsp());
362 362
 		// total td
363
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'item_r jst-rght' );
363
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'item_r jst-rght');
364 364
 		// end of row
365 365
 		$html .= EEH_HTML::trx();
366 366
 		return $html;
@@ -375,17 +375,17 @@  discard block
 block discarded – undo
375 375
 	 * @param string $text
376 376
 	 * @return mixed
377 377
 	 */
378
-	private function _total_tax_row( EE_Line_Item $line_item, $text = '' ) {
378
+	private function _total_tax_row(EE_Line_Item $line_item, $text = '') {
379 379
 		$html = '';
380
-		if ( $line_item->total() ) {
380
+		if ($line_item->total()) {
381 381
 			// start of row
382
-			$html = EEH_HTML::tr( '', '', 'total_tr odd' );
382
+			$html = EEH_HTML::tr('', '', 'total_tr odd');
383 383
 			// total td
384
-			$html .= EEH_HTML::td( $text, '', 'total_currency total jst-rght', '', ' colspan="2"' );
384
+			$html .= EEH_HTML::td($text, '', 'total_currency total jst-rght', '', ' colspan="2"');
385 385
 			// empty td (price)
386
-			$html .= EEH_HTML::td( EEH_HTML::nbsp() );
386
+			$html .= EEH_HTML::td(EEH_HTML::nbsp());
387 387
 			// total td
388
-			$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '', 'total jst-rght' );
388
+			$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'total jst-rght');
389 389
 			// end of row
390 390
 			$html .= EEH_HTML::trx();
391 391
 		}
@@ -402,15 +402,15 @@  discard block
 block discarded – undo
402 402
 	 * @param array        $options
403 403
 	 * @return mixed
404 404
 	 */
405
-	private function _sub_total_row( EE_Line_Item $line_item, $text = '', $options = array() ) {
405
+	private function _sub_total_row(EE_Line_Item $line_item, $text = '', $options = array()) {
406 406
 		$html = '';
407
-		if ( $line_item->total() ) {
407
+		if ($line_item->total()) {
408 408
 			// start of row
409
-			$html = EEH_HTML::tr( '', '', 'total_tr odd' );
409
+			$html = EEH_HTML::tr('', '', 'total_tr odd');
410 410
 			// total td
411
-			$html .= EEH_HTML::td( $text, '', 'total_currency total jst-rght', '', ' colspan="3"' );
411
+			$html .= EEH_HTML::td($text, '', 'total_currency total jst-rght', '', ' colspan="3"');
412 412
 			// total td
413
-			$html .= EEH_HTML::td( EEH_Template::format_currency( $options[ 'sub_total' ], false, false ), '', 'total jst-rght' );
413
+			$html .= EEH_HTML::td(EEH_Template::format_currency($options['sub_total'], false, false), '', 'total jst-rght');
414 414
 			// end of row
415 415
 			$html .= EEH_HTML::trx();
416 416
 		}
@@ -427,13 +427,13 @@  discard block
 block discarded – undo
427 427
 	 * @param string       $text
428 428
 	 * @return mixed
429 429
 	 */
430
-	private function _total_row( EE_Line_Item $line_item, $text = '' ) {
430
+	private function _total_row(EE_Line_Item $line_item, $text = '') {
431 431
 		// start of row
432
-		$html = EEH_HTML::tr( '', '', 'spco-grand-total total_tr odd' );
432
+		$html = EEH_HTML::tr('', '', 'spco-grand-total total_tr odd');
433 433
 		// total td
434
-		$html .= EEH_HTML::td( $text, '',  'total_currency total jst-rght',  '',  ' colspan="3"' );
434
+		$html .= EEH_HTML::td($text, '', 'total_currency total jst-rght', '', ' colspan="3"');
435 435
 		// total td
436
-		$html .= EEH_HTML::td( EEH_Template::format_currency( $line_item->total(), false, false ), '',  'total jst-rght' );
436
+		$html .= EEH_HTML::td(EEH_Template::format_currency($line_item->total(), false, false), '', 'total jst-rght');
437 437
 		// end of row
438 438
 		$html .= EEH_HTML::trx();
439 439
 		return $html;
@@ -448,30 +448,30 @@  discard block
 block discarded – undo
448 448
 	 * @param array        $options
449 449
 	 * @return mixed
450 450
 	 */
451
-	private function _payments_and_amount_owing_rows( EE_Line_Item $line_item, $options = array() ) {
451
+	private function _payments_and_amount_owing_rows(EE_Line_Item $line_item, $options = array()) {
452 452
 		$html = '';
453 453
 		$owing = $line_item->total();
454
-		$transaction = EEM_Transaction::instance()->get_one_by_ID( $line_item->TXN_ID() );
455
-		if ( $transaction instanceof EE_Transaction ) {
454
+		$transaction = EEM_Transaction::instance()->get_one_by_ID($line_item->TXN_ID());
455
+		if ($transaction instanceof EE_Transaction) {
456 456
 			$registration_payments = array();
457
-			$registrations = ! empty( $options['registrations'] )
458
-				? $options[ 'registrations' ]
457
+			$registrations = ! empty($options['registrations'])
458
+				? $options['registrations']
459 459
 				: $transaction->registrations();
460
-			foreach ( $registrations as $registration ) {
461
-				if ( $registration instanceof EE_Registration && $registration->owes_monies_and_can_pay() ) {
460
+			foreach ($registrations as $registration) {
461
+				if ($registration instanceof EE_Registration && $registration->owes_monies_and_can_pay()) {
462 462
 					$registration_payments = $registration_payments + $registration->registration_payments();
463 463
 				}
464 464
 			}
465
-			if ( ! empty( $registration_payments )) {
466
-				foreach ( $registration_payments as $registration_payment ) {
467
-					if ( $registration_payment instanceof EE_Registration_Payment ) {
465
+			if ( ! empty($registration_payments)) {
466
+				foreach ($registration_payments as $registration_payment) {
467
+					if ($registration_payment instanceof EE_Registration_Payment) {
468 468
 						$owing = $owing - $registration_payment->amount();
469 469
 						$payment = $registration_payment->payment();
470
-						if ( $payment instanceof EE_Payment ) {
470
+						if ($payment instanceof EE_Payment) {
471 471
 							$payment_desc = sprintf(
472
-								__( 'Payment%1$s Received: %2$s', 'event_espresso' ),
472
+								__('Payment%1$s Received: %2$s', 'event_espresso'),
473 473
 								$payment->txn_id_chq_nmbr() != ''
474
-									? ' <span class="small-text">(#' . $payment->txn_id_chq_nmbr() . ')</span> '
474
+									? ' <span class="small-text">(#'.$payment->txn_id_chq_nmbr().')</span> '
475 475
 									: '',
476 476
 								$payment->timestamp()
477 477
 							);
@@ -479,12 +479,12 @@  discard block
 block discarded – undo
479 479
 							$payment_desc = '';
480 480
 						}
481 481
 						// start of row
482
-						$html .= EEH_HTML::tr( '', '', 'total_tr odd' );
482
+						$html .= EEH_HTML::tr('', '', 'total_tr odd');
483 483
 						// payment desc
484
-						$html .= EEH_HTML::td( $payment_desc, '', '', '', ' colspan="3"' );
484
+						$html .= EEH_HTML::td($payment_desc, '', '', '', ' colspan="3"');
485 485
 						// total td
486 486
 						$html .= EEH_HTML::td(
487
-							EEH_Template::format_currency( $registration_payment->amount(), false, false ),
487
+							EEH_Template::format_currency($registration_payment->amount(), false, false),
488 488
 							'',
489 489
 							'total jst-rght'
490 490
 						);
@@ -492,17 +492,17 @@  discard block
 block discarded – undo
492 492
 						$html .= EEH_HTML::trx();
493 493
 					}
494 494
 				}
495
-				if ( $line_item->total() ) {
495
+				if ($line_item->total()) {
496 496
 					// start of row
497
-					$html .= EEH_HTML::tr( '', '', 'total_tr odd' );
497
+					$html .= EEH_HTML::tr('', '', 'total_tr odd');
498 498
 					// total td
499 499
 					$html .= EEH_HTML::td(
500 500
 						__('Amount Owing', 'event_espresso'),
501
-						'',  'total_currency total jst-rght',  '',  ' colspan="3"'
501
+						'', 'total_currency total jst-rght', '', ' colspan="3"'
502 502
 					);
503 503
 					// total td
504 504
 					$html .= EEH_HTML::td(
505
-						EEH_Template::format_currency( $owing, false, false ), '',  'total jst-rght'
505
+						EEH_Template::format_currency($owing, false, false), '', 'total jst-rght'
506 506
 					);
507 507
 					// end of row
508 508
 					$html .= EEH_HTML::trx();
Please login to merge, or discard this patch.
core/libraries/messages/defaults/EE_Messages_Template_Pack.core.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -316,6 +316,7 @@
 block discarded – undo
316 316
 	 * @param EE_message_type $message_type
317 317
 	 * @param string          $field          The field reference for the specific template being looked up.
318 318
 	 * @param string          $context      The context reference for the specific template being looked up
319
+	 * @param EE_Messages_Template_Pack_Default|null $default_pack
319 320
 	 *
320 321
 	 * @return string          The template contents.
321 322
 	 */
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@  discard block
 block discarded – undo
5 5
  * @subpackage messages
6 6
  * @since           4.5.0
7 7
  */
8
-if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
8
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
9
+	exit('No direct script access allowed');
10
+}
9 11
 
10 12
 /**
11 13
  * EE_Template_Packs are classes that contain all the information related to messages templates for a given "template pack".
@@ -282,8 +284,9 @@  discard block
 block discarded – undo
282 284
 
283 285
 		foreach ( $contexts as $context => $details ) {
284 286
 			foreach ( $fields as $field => $field_details ) {
285
-				if ( empty( $field_details ) )
286
-					continue;
287
+				if ( empty( $field_details ) ) {
288
+									continue;
289
+				}
287 290
 				/**
288 291
 				 * is this a field array (linked to a main field)?
289 292
 				 */
Please login to merge, or discard this patch.
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -167,44 +167,44 @@  discard block
 block discarded – undo
167 167
 	public function __construct() {
168 168
 		$this->_set_props();
169 169
 		//make sure classname is correct
170
-		$classname = get_class( $this );
170
+		$classname = get_class($this);
171 171
 		//make sure required props have been set
172 172
 
173 173
 		//if label is empty then throw an error because we should have it defined by now.
174
-		if ( ! isset( $this->label )  ) {
175
-			throw new EE_Error( sprintf( __('The label property is not set for %s.  Please ensure that is set for the class.', 'event_espresso' ), $classname ) );
174
+		if ( ! isset($this->label)) {
175
+			throw new EE_Error(sprintf(__('The label property is not set for %s.  Please ensure that is set for the class.', 'event_espresso'), $classname));
176 176
 		}
177 177
 
178 178
 
179 179
 		//the reference for this template pack
180
-		if ( ! isset( $this->dbref )  ) {
181
-			throw new EE_Error( sprintf( __('The dbref property is not set for %s.  Please ensure that is set for the class.', 'event_espresso' ), $classname ) );
180
+		if ( ! isset($this->dbref)) {
181
+			throw new EE_Error(sprintf(__('The dbref property is not set for %s.  Please ensure that is set for the class.', 'event_espresso'), $classname));
182 182
 		}
183 183
 
184 184
 		//make sure dbref is safe
185
-		$this->dbref = str_replace( '-', '_', sanitize_key( $this->dbref ) );
185
+		$this->dbref = str_replace('-', '_', sanitize_key($this->dbref));
186 186
 
187
-		$should_be = 'EE_Messages_Template_Pack_' . str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $this->dbref ) ) );
187
+		$should_be = 'EE_Messages_Template_Pack_'.str_replace(' ', '_', ucwords(str_replace('_', ' ', $this->dbref)));
188 188
 
189
-		if ( $should_be !== $classname ) {
190
-			throw new EE_Error( sprintf( __('The name of the template pack instantiated class is "%s".  It should be "%s".  Make sure that the name of the template pack class matches is prepended with "EE_Messages_Template_Pack_" and appended with a sentence case iteration of the value for your template pack\'s dbref property.', 'event_espresso' ), $classname, $should_be ) );
189
+		if ($should_be !== $classname) {
190
+			throw new EE_Error(sprintf(__('The name of the template pack instantiated class is "%s".  It should be "%s".  Make sure that the name of the template pack class matches is prepended with "EE_Messages_Template_Pack_" and appended with a sentence case iteration of the value for your template pack\'s dbref property.', 'event_espresso'), $classname, $should_be));
191 191
 		}
192 192
 
193 193
 		//if _base_path is not set then throw an error because a base path string is needed.
194
-		if ( empty( $this->_base_path ) ) {
195
-			throw new EE_Error( sprintf( __('The _base_path property is not set for %s.  Please ensure that is set for the class.', 'event_espresso' ), $classname ) );
194
+		if (empty($this->_base_path)) {
195
+			throw new EE_Error(sprintf(__('The _base_path property is not set for %s.  Please ensure that is set for the class.', 'event_espresso'), $classname));
196 196
 		}
197 197
 
198 198
 
199 199
 		//if _base_url is not set then throw an error because a  string is needed for variations.
200
-		if ( empty( $this->_base_url ) ) {
201
-			throw new EE_Error( sprintf( __('The _base_url property is not set for %s.  Please ensure that is set for the class.', 'event_espresso' ), $classname ) );
200
+		if (empty($this->_base_url)) {
201
+			throw new EE_Error(sprintf(__('The _base_url property is not set for %s.  Please ensure that is set for the class.', 'event_espresso'), $classname));
202 202
 		}
203 203
 
204 204
 
205 205
 		//if $supports is not set then throw an error because that effectively means this template_pack does not have any templates!
206
-		if ( empty( $this->_supports ) ) {
207
-			throw new EE_Error( sprintf( __('The supports property is not set for %s.  Please ensure that is set for the class.', 'event_espresso' ), $classname ) );
206
+		if (empty($this->_supports)) {
207
+			throw new EE_Error(sprintf(__('The supports property is not set for %s.  Please ensure that is set for the class.', 'event_espresso'), $classname));
208 208
 		}
209 209
 
210 210
 
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
 	 *
242 242
 	 * @return array
243 243
 	 */
244
-	public function get_templates( EE_messenger $messenger, EE_message_type $message_type ) {
245
-		return isset( $this->_templates[$messenger->name][$message_type->name] ) ? $this->_templates[$messenger->name][$message_type->name] : $this->_get_templates( $messenger, $message_type );
244
+	public function get_templates(EE_messenger $messenger, EE_message_type $message_type) {
245
+		return isset($this->_templates[$messenger->name][$message_type->name]) ? $this->_templates[$messenger->name][$message_type->name] : $this->_get_templates($messenger, $message_type);
246 246
 	}
247 247
 
248 248
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	 * @return array          Returns an multi-level associative array indexed by template context and field in the format:
260 260
 	 *                                array( 'context' => array( 'field' => 'value', 'another-field', 'value' ) );
261 261
 	 */
262
-	protected function _get_templates( EE_messenger $messenger, EE_message_type $message_type ) {
262
+	protected function _get_templates(EE_messenger $messenger, EE_message_type $message_type) {
263 263
 		$templates = array();
264 264
 
265 265
 		/**
@@ -278,28 +278,28 @@  discard block
 block discarded – undo
278 278
 		$contexts = $message_type->get_contexts();
279 279
 
280 280
 
281
-		foreach ( $contexts as $context => $details ) {
282
-			foreach ( $fields as $field => $field_details ) {
283
-				if ( empty( $field_details ) )
281
+		foreach ($contexts as $context => $details) {
282
+			foreach ($fields as $field => $field_details) {
283
+				if (empty($field_details))
284 284
 					continue;
285 285
 				/**
286 286
 				 * is this a field array (linked to a main field)?
287 287
 				 */
288
-				if ( $field == 'extra'  ) {
289
-					foreach ( $field_details as $main_field => $sub_fields ) {
290
-						foreach ( $sub_fields as $sub_field => $sub_field_details ) {
288
+				if ($field == 'extra') {
289
+					foreach ($field_details as $main_field => $sub_fields) {
290
+						foreach ($sub_fields as $sub_field => $sub_field_details) {
291 291
 							//make sure that the template_field_ref matches what the main template field is for this template group.
292 292
 							$template_field_ref = $sub_field == 'main' ? $main_field : $sub_field;
293
-							$templates[ $context ][ $main_field ][ $sub_field ] = $this->_get_specific_template( $default_pack, $messenger, $message_type, $template_field_ref, $context );
293
+							$templates[$context][$main_field][$sub_field] = $this->_get_specific_template($default_pack, $messenger, $message_type, $template_field_ref, $context);
294 294
 						}
295 295
 					}
296 296
 				} else {
297
-					$templates[ $context ][ $field ] = $this->_get_specific_template( $default_pack, $messenger, $message_type, $field, $context );
297
+					$templates[$context][$field] = $this->_get_specific_template($default_pack, $messenger, $message_type, $field, $context);
298 298
 				}
299 299
 			}
300 300
 		}
301 301
 
302
-		$templates = apply_filters( 'FHEE__EE_Template_Pack___get_templates__templates', $templates, $messenger, $message_type, $this );
302
+		$templates = apply_filters('FHEE__EE_Template_Pack___get_templates__templates', $templates, $messenger, $message_type, $this);
303 303
 
304 304
 		$this->_templates[$messenger->name][$message_type->name] = $templates;
305 305
 		 return $templates;
@@ -317,22 +317,22 @@  discard block
 block discarded – undo
317 317
 	 *
318 318
 	 * @return string          The template contents.
319 319
 	 */
320
-	protected function _get_specific_template( $default_pack, EE_messenger $messenger, EE_message_type $message_type, $field, $context ) {
320
+	protected function _get_specific_template($default_pack, EE_messenger $messenger, EE_message_type $message_type, $field, $context) {
321 321
 
322 322
 		//default templates
323
-		$default_templates = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_templates( $messenger, $message_type ) : array();
323
+		$default_templates = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_templates($messenger, $message_type) : array();
324 324
 
325 325
 		//first we allow for the $_base_path to be filtered.  However, we assign this to a new variable so that we have the original base_path as a fallback.
326
-		$filtered_base_path = apply_filters( 'FHEE__EE_Template_Pack___get_specific_template__filtered_base_path', $this->_base_path, $messenger, $message_type, $field, $context, $this );
326
+		$filtered_base_path = apply_filters('FHEE__EE_Template_Pack___get_specific_template__filtered_base_path', $this->_base_path, $messenger, $message_type, $field, $context, $this);
327 327
 
328 328
 		$master_templates = $message_type->get_master_templates();
329
-		$master_templates_mt = isset( $master_templates[$messenger->name] ) ? $master_templates[$messenger->name] : $message_type->name;
330
-		$full_path = $filtered_base_path . $messenger->name . '_' . $message_type->name . '_' . $field . '_' . $context . '.template.php';
331
-		$fallback_path = $filtered_base_path . $messenger->name . '_' . $message_type->name . '_' . $field . '.template.php';
332
-		$mt_defined_full_path = $filtered_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '_' . $context . '.template.php';
333
-		$mt_defined_fallback_path = $filtered_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '.template.php';
334
-		$base_defined_full_path = $this->_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '_' . $context . '.template.php';
335
-		$base_defined_fallback_path = $this->_base_path . $messenger->name . '_' . $master_templates_mt . '_' . $field . '.template.php';
329
+		$master_templates_mt = isset($master_templates[$messenger->name]) ? $master_templates[$messenger->name] : $message_type->name;
330
+		$full_path = $filtered_base_path.$messenger->name.'_'.$message_type->name.'_'.$field.'_'.$context.'.template.php';
331
+		$fallback_path = $filtered_base_path.$messenger->name.'_'.$message_type->name.'_'.$field.'.template.php';
332
+		$mt_defined_full_path = $filtered_base_path.$messenger->name.'_'.$master_templates_mt.'_'.$field.'_'.$context.'.template.php';
333
+		$mt_defined_fallback_path = $filtered_base_path.$messenger->name.'_'.$master_templates_mt.'_'.$field.'.template.php';
334
+		$base_defined_full_path = $this->_base_path.$messenger->name.'_'.$master_templates_mt.'_'.$field.'_'.$context.'.template.php';
335
+		$base_defined_fallback_path = $this->_base_path.$messenger->name.'_'.$master_templates_mt.'_'.$field.'.template.php';
336 336
 
337 337
 		/**
338 338
 		 * Template checks are done hierarchically in the following order:
@@ -346,28 +346,28 @@  discard block
 block discarded – undo
346 346
 		 */
347 347
 
348 348
 
349
-		if ( is_readable( $full_path ) ) {
349
+		if (is_readable($full_path)) {
350 350
 			$actual_path = $full_path;
351
-		} elseif ( is_readable( $fallback_path ) ) {
351
+		} elseif (is_readable($fallback_path)) {
352 352
 			$actual_path = $fallback_path;
353
-		} elseif ( is_readable( $mt_defined_full_path ) ) {
353
+		} elseif (is_readable($mt_defined_full_path)) {
354 354
 			$actual_path = $mt_defined_full_path;
355
-		} elseif ( is_readable( $mt_defined_fallback_path ) ) {
355
+		} elseif (is_readable($mt_defined_fallback_path)) {
356 356
 			$actual_path = $mt_defined_fallback_path;
357
-		} elseif ( is_readable( $base_defined_full_path ) ) {
357
+		} elseif (is_readable($base_defined_full_path)) {
358 358
 			$actual_path = $base_defined_full_path;
359
-		} elseif ( is_readable( $base_defined_fallback_path ) ) {
359
+		} elseif (is_readable($base_defined_fallback_path)) {
360 360
 			$actual_path = $base_defined_fallback_path;
361
-		} else  {
361
+		} else {
362 362
 			$actual_path = '';
363 363
 		}
364
-		if ( empty( $actual_path ) ) {
365
-			$contents = isset( $default_templates[$context][$field] ) ? $default_templates[$context][$field] : '';
364
+		if (empty($actual_path)) {
365
+			$contents = isset($default_templates[$context][$field]) ? $default_templates[$context][$field] : '';
366 366
 		} else {
367
-			$contents = EEH_Template::display_template( $actual_path, array(), TRUE );
367
+			$contents = EEH_Template::display_template($actual_path, array(), TRUE);
368 368
 		}
369 369
 
370
-		return apply_filters( 'FHEE__EE_Messages_Template_Pack__get_specific_template__contents', $contents, $actual_path, $messenger, $message_type, $field, $context, $this );
370
+		return apply_filters('FHEE__EE_Messages_Template_Pack__get_specific_template__contents', $contents, $actual_path, $messenger, $message_type, $field, $context, $this);
371 371
 	}
372 372
 
373 373
 
@@ -382,8 +382,8 @@  discard block
 block discarded – undo
382 382
 	 * @return array
383 383
 	 */
384 384
 	public function get_supports() {
385
-		$supports = apply_filters( 'FHEE__' . get_class( $this ) . '__get_supports', $this->_supports );
386
-		return apply_filters( 'FHEE__EE_Messages_Template_Pack__get_supports', $supports, $this );
385
+		$supports = apply_filters('FHEE__'.get_class($this).'__get_supports', $this->_supports);
386
+		return apply_filters('FHEE__EE_Messages_Template_Pack__get_supports', $supports, $this);
387 387
 	}
388 388
 
389 389
 
@@ -398,11 +398,11 @@  discard block
 block discarded – undo
398 398
 	 *
399 399
 	 * @return array|string
400 400
 	 */
401
-	public function get_default_variation_labels( $messenger = '' ) {
402
-		$label = empty( $messenger ) ? $this->_default_variation_labels : array();
403
-		$label = empty( $label ) && ! empty( $this->_default_variation_labels[$messenger] ) ? $this->_default_variation_labels[$messenger] : __('Default', 'event_espresso');
401
+	public function get_default_variation_labels($messenger = '') {
402
+		$label = empty($messenger) ? $this->_default_variation_labels : array();
403
+		$label = empty($label) && ! empty($this->_default_variation_labels[$messenger]) ? $this->_default_variation_labels[$messenger] : __('Default', 'event_espresso');
404 404
 
405
-		return apply_filters( 'FHEE__EE_Messages_Template_Pack__get_default_variation_labels', $label, $this->_default_variation_labels, $messenger );
405
+		return apply_filters('FHEE__EE_Messages_Template_Pack__get_default_variation_labels', $label, $this->_default_variation_labels, $messenger);
406 406
 	}
407 407
 
408 408
 
@@ -418,25 +418,25 @@  discard block
 block discarded – undo
418 418
 	 * @param string $message_type if included then css variations matching the message_type are returned (must have $messenger set).  Otherwise the array of variations per message type are returned.  If message_type is provided but NOT the messenger, then just all variations for all messengers are returned.
419 419
 	 * @return array
420 420
 	 */
421
-	public function get_variations( $messenger = '', $message_type = '' ) {
422
-		$messenger_variations = ! empty( $messenger ) && isset( $this->_variations[$messenger] ) ? $this->_variations[$messenger] : array();
421
+	public function get_variations($messenger = '', $message_type = '') {
422
+		$messenger_variations = ! empty($messenger) && isset($this->_variations[$messenger]) ? $this->_variations[$messenger] : array();
423 423
 
424 424
 		//message_type provided? IF so, then we've requested a specific set of variations, so we need to make sure we set it as empty if that's not present.
425
-		$variations = !empty( $messenger ) && !empty( $message_type ) && isset( $messenger_variations[$message_type] ) ? $messenger_variations[$message_type] : array();
425
+		$variations = ! empty($messenger) && ! empty($message_type) && isset($messenger_variations[$message_type]) ? $messenger_variations[$message_type] : array();
426 426
 
427 427
 		//now let's account for the possibility we just want all the variations for a messenger (which is indicated by providing the messenger but not the message type).
428
-		$variations = empty( $variations ) && !empty( $messenger ) && empty( $message_type ) ? $messenger_variations : $variations;
428
+		$variations = empty($variations) && ! empty($messenger) && empty($message_type) ? $messenger_variations : $variations;
429 429
 
430 430
 		//filter per template pack and globally.
431
-		$variations = apply_filters( 'FHEE__' . get_class( $this ) . '__get_variations', $variations, $messenger, $message_type );
432
-		$variations = apply_filters( 'FHEE__EE_Messages_Template_Pack__get_variations', $variations, $messenger, $message_type, $this );
431
+		$variations = apply_filters('FHEE__'.get_class($this).'__get_variations', $variations, $messenger, $message_type);
432
+		$variations = apply_filters('FHEE__EE_Messages_Template_Pack__get_variations', $variations, $messenger, $message_type, $this);
433 433
 
434 434
 		//prepend the _default_variation, but ONLY if we're returning the fully validated array.
435
-		if ( !empty( $messenger ) && !empty( $message_type ) && ! empty( $variations ) ) {
436
-			$variations = array( 'default' => $this->get_default_variation_labels( $messenger ) ) + $variations;
435
+		if ( ! empty($messenger) && ! empty($message_type) && ! empty($variations)) {
436
+			$variations = array('default' => $this->get_default_variation_labels($messenger)) + $variations;
437 437
 		}
438 438
 
439
-		return empty( $variations ) ? array( 'default' => $this->get_default_variation_labels('dft') ): $variations;
439
+		return empty($variations) ? array('default' => $this->get_default_variation_labels('dft')) : $variations;
440 440
 	}
441 441
 
442 442
 
@@ -457,39 +457,39 @@  discard block
 block discarded – undo
457 457
 	 *
458 458
 	 * @return string The variation path or url (typically css reference)
459 459
 	 */
460
-	public function get_variation( $messenger, $message_type, $type, $variation, $url = true, $file_extension = '.css', $skip_filters = FALSE ) {
460
+	public function get_variation($messenger, $message_type, $type, $variation, $url = true, $file_extension = '.css', $skip_filters = FALSE) {
461 461
 
462 462
 		$base = $url ? $this->_base_url : $this->_base_path;
463 463
 		$base_path = $this->_base_path;
464 464
 
465
-		if ( ! $skip_filters ) {
466
-			$base =  apply_filters( 'FHEE__EE_Messages_Template_Pack__get_variation__base_path_or_url', $base, $messenger, $message_type, $type, $variation, $url, $file_extension, $this );
467
-			$base_path = apply_filters( 'FHEE__EE_Messages_Template_Pack__get_variation__base_path', $base_path, $messenger, $message_type, $type, $variation, FALSE, $file_extension, $this );
465
+		if ( ! $skip_filters) {
466
+			$base = apply_filters('FHEE__EE_Messages_Template_Pack__get_variation__base_path_or_url', $base, $messenger, $message_type, $type, $variation, $url, $file_extension, $this);
467
+			$base_path = apply_filters('FHEE__EE_Messages_Template_Pack__get_variation__base_path', $base_path, $messenger, $message_type, $type, $variation, FALSE, $file_extension, $this);
468 468
 		}
469 469
 
470
-		$default_pack = get_class( $this ) != 'EE_Messages_Template_Pack_Default' ? new EE_Messages_Template_Pack_Default() : $this;
470
+		$default_pack = get_class($this) != 'EE_Messages_Template_Pack_Default' ? new EE_Messages_Template_Pack_Default() : $this;
471 471
 
472 472
 		//possible variation paths considering whether message type is present or not in the file name.
473
-		$path_string = 'variations/' . $messenger . '_' . $message_type . '_'  . $type . '_' . $variation . $file_extension;
474
-		$default_path_string = 'variations/' . $messenger . '_' . $type . '_' . $variation . $file_extension;
473
+		$path_string = 'variations/'.$messenger.'_'.$message_type.'_'.$type.'_'.$variation.$file_extension;
474
+		$default_path_string = 'variations/'.$messenger.'_'.$type.'_'.$variation.$file_extension;
475 475
 
476 476
 		//first see if fully validated file exists.
477
-		if ( is_readable( $base_path . $path_string ) ) {
478
-			$variation_path = $base . $path_string;
477
+		if (is_readable($base_path.$path_string)) {
478
+			$variation_path = $base.$path_string;
479 479
 		//otherwise see if default exists.
480
-		} elseif ( is_readable( $base_path . $default_path_string ) ) {
481
-			$variation_path = $base . $default_path_string;
480
+		} elseif (is_readable($base_path.$default_path_string)) {
481
+			$variation_path = $base.$default_path_string;
482 482
 		} else {
483
-			$variation_path = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_default_variation( $messenger, $message_type, $type, $url, $file_extension ) : '';
483
+			$variation_path = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_default_variation($messenger, $message_type, $type, $url, $file_extension) : '';
484 484
 		}
485 485
 
486
-		if ( $skip_filters ) {
486
+		if ($skip_filters) {
487 487
 			return $variation_path;
488 488
 		}
489 489
 
490 490
 		//filter result
491
-		$variation_path = apply_filters( 'FHEE__' . get_class( $this ) . '__get_variation', $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url );
492
-		return apply_filters( 'FHEE__EE_Messages_Template_Pack__get_variation', $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, $this );
491
+		$variation_path = apply_filters('FHEE__'.get_class($this).'__get_variation', $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url);
492
+		return apply_filters('FHEE__EE_Messages_Template_Pack__get_variation', $variation_path, $messenger, $message_type, $type, $variation, $file_extension, $url, $this);
493 493
 	}
494 494
 
495 495
 
@@ -504,19 +504,19 @@  discard block
 block discarded – undo
504 504
 	 *
505 505
 	 * @return string returns the path for the requested wrapper template.
506 506
 	 */
507
-	public function get_wrapper( $messenger, $type = 'main' ) {
508
-		$default_pack = get_class( $this ) !== 'EE_Messages_Template_Pack_Default' ? new EE_Messages_Template_Pack_Default() : NULL;
507
+	public function get_wrapper($messenger, $type = 'main') {
508
+		$default_pack = get_class($this) !== 'EE_Messages_Template_Pack_Default' ? new EE_Messages_Template_Pack_Default() : NULL;
509 509
 
510
-		$path_string = $this->_base_path . $messenger . '_' . $type . '_wrapper.template.php';
510
+		$path_string = $this->_base_path.$messenger.'_'.$type.'_wrapper.template.php';
511 511
 
512
-		if ( is_readable( $path_string ) ) {
512
+		if (is_readable($path_string)) {
513 513
 			$template = $path_string;
514 514
 		} else {
515
-			$template = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_wrapper( $messenger, $type ) : '';
515
+			$template = $default_pack instanceof EE_Messages_Template_Pack_Default ? $default_pack->get_wrapper($messenger, $type) : '';
516 516
 		}
517 517
 
518 518
 		//filter
519
-		$template = apply_filters( 'FHEE__' . get_class( $this ) . '__get_wrapper', $template, $messenger, $type );
520
-		return apply_filters( 'FHEE__EE_Messages_Template_Pack__get_wrapper', $template, $messenger, $type, $this );
519
+		$template = apply_filters('FHEE__'.get_class($this).'__get_wrapper', $template, $messenger, $type);
520
+		return apply_filters('FHEE__EE_Messages_Template_Pack__get_wrapper', $template, $messenger, $type, $this);
521 521
 	}
522 522
 }
Please login to merge, or discard this patch.
core/libraries/messages/messenger/EE_Pdf_messenger.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -332,7 +332,7 @@
 block discarded – undo
332 332
 
333 333
 
334 334
 	/**
335
-	 * @return string
335
+	 * @return boolean|null
336 336
 	 */
337 337
 	protected function _preview() { return $this->_send_message(); }
338 338
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if (!defined('EVENT_ESPRESSO_VERSION') ) {
10 10
 	exit('NO direct script access allowed');
11
+}
11 12
 
12 13
 /**
13 14
  *
Please login to merge, or discard this patch.
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @package Event Espresso
7 7
  * @subpackage messages
8 8
  */
9
-if (!defined('EVENT_ESPRESSO_VERSION') )
9
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
10 10
 	exit('NO direct script access allowed');
11 11
 
12 12
 /**
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  * @subpackage		messages
21 21
  * @author			Darren Ethier
22 22
  */
23
-class EE_Pdf_messenger extends EE_messenger  {
23
+class EE_Pdf_messenger extends EE_messenger {
24 24
 
25 25
 
26 26
 	/**
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 * @see abstract declaration in EE_messenger for details.
66 66
 	 */
67 67
 	protected function _set_admin_pages() {
68
-		$this->admin_registered_pages = array( 'events_edit' => false );
68
+		$this->admin_registered_pages = array('events_edit' => false);
69 69
 	}
70 70
 
71 71
 
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
 	protected function _set_validator_config() {
86 86
 		$this->_validator_config = array(
87 87
 			'subject' => array(
88
-				'shortcodes' => array('recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email','event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime')
88
+				'shortcodes' => array('recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email', 'event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime')
89 89
 				),
90 90
 			'content' => array(
91
-				'shortcodes' => array( 'recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email','event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime')
91
+				'shortcodes' => array('recipient_details', 'organization', 'event', 'ticket', 'venue', 'primary_registration_details', 'event_author', 'email', 'event_meta', 'recipient_list', 'transaction', 'datetime_list', 'datetime')
92 92
 				),
93 93
 			'attendee_list' => array(
94 94
 				'shortcodes' => array('attendee', 'event_list', 'ticket_list'),
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 				'required' => array('[EVENT_LIST]')
100 100
 				),
101 101
 			'ticket_list' => array(
102
-				'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list','primary_registration_details', 'recipient_details'),
102
+				'shortcodes' => array('event_list', 'attendee_list', 'ticket', 'datetime_list', 'primary_registration_details', 'recipient_details'),
103 103
 				'required' => array('[TICKET_LIST]')
104 104
 				),
105 105
 			'datetime_list' => array(
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 	 */
120 120
 	public  function enqueue_scripts_styles() {
121 121
 		parent::enqueue_scripts_styles();
122
-		do_action( 'AHEE__EE_Pdf_messenger__enqueue_scripts_styles');
122
+		do_action('AHEE__EE_Pdf_messenger__enqueue_scripts_styles');
123 123
 	}
124 124
 
125 125
 
@@ -245,18 +245,18 @@  discard block
 block discarded – undo
245 245
 	 */
246 246
 	protected function _send_message() {
247 247
 		$this->_template_args = array(
248
-			'page_title' => html_entity_decode( stripslashes( $this->_subject ), ENT_QUOTES, "UTF-8"),
249
-			'base_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation ),
250
-			'print_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation ),
251
-			'main_css' => $this->get_variation( $this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation ),
252
-			'extra_css' => EE_LIBRARIES_URL . 'messages/defaults/default/variations/pdf_base_default.css',
253
-			'main_body' => apply_filters( 'FHEE__EE_Pdf_messenger___send_message__main_body', wpautop(stripslashes_deep( html_entity_decode($this->_content,  ENT_QUOTES,"UTF-8" ) )), $this->_content )
248
+			'page_title' => html_entity_decode(stripslashes($this->_subject), ENT_QUOTES, "UTF-8"),
249
+			'base_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'base', $this->_variation),
250
+			'print_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'print', $this->_variation),
251
+			'main_css' => $this->get_variation($this->_tmp_pack, $this->_incoming_message_type->name, TRUE, 'main', $this->_variation),
252
+			'extra_css' => EE_LIBRARIES_URL.'messages/defaults/default/variations/pdf_base_default.css',
253
+			'main_body' => apply_filters('FHEE__EE_Pdf_messenger___send_message__main_body', wpautop(stripslashes_deep(html_entity_decode($this->_content, ENT_QUOTES, "UTF-8"))), $this->_content)
254 254
 			);
255 255
 		$this->_deregister_wp_hooks();
256
-		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts_styles' ) );
256
+		add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_styles'));
257 257
 		$content = $this->_get_main_template();
258 258
 //		die( $content );
259
-		$this->_do_pdf( $content );
259
+		$this->_do_pdf($content);
260 260
 		exit(0);
261 261
 	}
262 262
 
@@ -280,8 +280,8 @@  discard block
 block discarded – undo
280 280
 
281 281
 		//just add back in wp_enqueue_scripts and wp_print_footer_scripts cause that's all we want to load.
282 282
 		add_action('wp_head', 'wp_enqueue_scripts');
283
-		add_action( 'wp_footer', 'wp_print_footer_scripts' );
284
-		add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' );
283
+		add_action('wp_footer', 'wp_print_footer_scripts');
284
+		add_action('wp_print_footer_scripts', '_wp_footer_scripts');
285 285
 	}
286 286
 
287 287
 
@@ -294,11 +294,11 @@  discard block
 block discarded – undo
294 294
 	 * @param bool $preview
295 295
 	 * @return string
296 296
 	 */
297
-	protected function _get_main_template( $preview = FALSE ) {
298
-		$wrapper_template = $this->_tmp_pack->get_wrapper( 'html', 'main' );
297
+	protected function _get_main_template($preview = FALSE) {
298
+		$wrapper_template = $this->_tmp_pack->get_wrapper('html', 'main');
299 299
 		//add message type to template_args
300 300
 		$this->_template_args['message_type'] = $this->_incoming_message_type;
301
-		return EEH_Template::display_template( $wrapper_template, $this->_template_args, TRUE );
301
+		return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE);
302 302
 	}
303 303
 
304 304
 
@@ -311,21 +311,21 @@  discard block
 block discarded – undo
311 311
 	 *
312 312
 	 * @return void
313 313
 	 */
314
-	protected function _do_pdf( $content = '' ) {
315
-		$invoice_name = html_entity_decode( $this->_subject, ENT_QUOTES, "UTF-8");
314
+	protected function _do_pdf($content = '') {
315
+		$invoice_name = html_entity_decode($this->_subject, ENT_QUOTES, "UTF-8");
316 316
 
317 317
 		//only load dompdf if nobody else has yet...
318
-		if( ! defined('DOMPDF_DIR')){
318
+		if ( ! defined('DOMPDF_DIR')) {
319 319
 			define('DOMPDF_ENABLE_REMOTE', TRUE);
320 320
 			define('DOMPDF_ENABLE_JAVASCRIPT', FALSE);
321 321
 			define('DOMPDF_ENABLE_CSS_FLOAT', TRUE);
322
-			require_once(EE_THIRD_PARTY . 'dompdf/dompdf_config.inc.php');
322
+			require_once(EE_THIRD_PARTY.'dompdf/dompdf_config.inc.php');
323 323
 		}
324 324
 		$dompdf = new DOMPDF();
325 325
 		$dompdf->load_html($content);
326 326
 		$dompdf->render();
327 327
 		//forcing the browser to open a download dialog.
328
-		$dompdf->stream($invoice_name . ".pdf", array( 'Attachment' => TRUE ));
328
+		$dompdf->stream($invoice_name.".pdf", array('Attachment' => TRUE));
329 329
 	}
330 330
 
331 331
 
Please login to merge, or discard this patch.