Completed
Branch DECAF-4.7 (a62460)
by
unknown
357:16 queued 343:55
created
core/libraries/form_sections/inputs/EE_Yes_No_Input.input.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,14 +6,14 @@
 block discarded – undo
6 6
  * @subpackage
7 7
  * @author				Mike Nelson
8 8
  */
9
-class EE_Yes_No_Input extends EE_Select_Input{
9
+class EE_Yes_No_Input extends EE_Select_Input {
10 10
 
11 11
 	/**
12 12
 	 * @param array $options
13 13
 	 */
14
-	function __construct( $options = array()){
15
-		$select_options = array(true=>  __("Yes", "event_espresso"),false=>  __("No", "event_espresso"));
14
+	function __construct($options = array()) {
15
+		$select_options = array(true=>  __("Yes", "event_espresso"), false=>  __("No", "event_espresso"));
16 16
 
17
-		parent::__construct($select_options,$options);
17
+		parent::__construct($select_options, $options);
18 18
 	}
19 19
 }
Please login to merge, or discard this patch.
form_sections/payment_methods/EE_Billing_Attendee_Info_Form.form.php 2 patches
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
3
-	exit( 'No direct script access allowed' );
2
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
3
+	exit('No direct script access allowed');
4 4
 }
5 5
 
6 6
 /**
@@ -14,31 +14,31 @@  discard block
 block discarded – undo
14 14
  * @author				Mike Nelson
15 15
  *
16 16
  */
17
-class EE_Billing_Attendee_Info_Form extends EE_Billing_Info_Form{
17
+class EE_Billing_Attendee_Info_Form extends EE_Billing_Info_Form {
18 18
 
19 19
 	/**
20 20
 	 *
21 21
 	 * @param EE_Payment_Method $payment_method
22 22
 	 * @param array $options_array @see EE_Form_Section_Proper::__construct()
23 23
 	 */
24
-	public function __construct( EE_Payment_Method $payment_method, $options_array= array()){
24
+	public function __construct(EE_Payment_Method $payment_method, $options_array = array()) {
25 25
 		$options_array['subsections'] = array_merge(
26 26
 			array(
27
-				'first_name' 	=> new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-fname', 'html_label_text' => __( 'First Name', 'event_espresso' ) ) ),
28
-				'last_name'		=> new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-lname', 'html_label_text' => __( 'Last Name', 'event_espresso' ) ) ),
29
-				'email'				=> new EE_Email_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-email', 'html_label_text' => __( 'Email', 'event_espresso' ) ) ),
30
-				'address'			=> new EE_Text_Input( array( 'html_label_text'=>  __( 'Address', 'event_espresso'), 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-address' )),
31
-				'address2'		=> new EE_Text_Input( array( 'html_label_text'=> __( 'Address 2', 'event_espresso'), 'html_class' => 'ee-billing-qstn ee-billing-qstn-address2' )),
32
-				'city'					=> new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-city', 'html_label_text' => __( 'City', 'event_espresso' ) ) ),
33
-				'state' 				=> apply_filters( 'FHEE__EE_Billing_Attendee_Info_Form__state_field', new EE_State_Select_Input( NULL, array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-state', 'html_label_text' => __( 'State', 'event_espresso' ) ) ) ),
34
-				'country' 			=> apply_filters( 'FHEE__EE_Billing_Attendee_Info_Form__country_field', new EE_Country_Select_Input( NULL, array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-country', 'html_label_text' => __( 'Country', 'event_espresso' ) ) ) ),
35
-				'zip'					=> new EE_Text_Input( array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-zip', 'html_label_text' => __( 'Zip', 'event_espresso' ) ) ),
36
-				'phone'			=> new EE_Text_Input( array( 'html_class' => 'ee-billing-qstn ee-billing-qstn-phone', 'html_label_text' => __( 'Phone', 'event_espresso' ) )),
27
+				'first_name' 	=> new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-fname', 'html_label_text' => __('First Name', 'event_espresso'))),
28
+				'last_name'		=> new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-lname', 'html_label_text' => __('Last Name', 'event_espresso'))),
29
+				'email'				=> new EE_Email_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-email', 'html_label_text' => __('Email', 'event_espresso'))),
30
+				'address'			=> new EE_Text_Input(array('html_label_text'=>  __('Address', 'event_espresso'), 'required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-address')),
31
+				'address2'		=> new EE_Text_Input(array('html_label_text'=> __('Address 2', 'event_espresso'), 'html_class' => 'ee-billing-qstn ee-billing-qstn-address2')),
32
+				'city'					=> new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-city', 'html_label_text' => __('City', 'event_espresso'))),
33
+				'state' 				=> apply_filters('FHEE__EE_Billing_Attendee_Info_Form__state_field', new EE_State_Select_Input(NULL, array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-state', 'html_label_text' => __('State', 'event_espresso')))),
34
+				'country' 			=> apply_filters('FHEE__EE_Billing_Attendee_Info_Form__country_field', new EE_Country_Select_Input(NULL, array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-country', 'html_label_text' => __('Country', 'event_espresso')))),
35
+				'zip'					=> new EE_Text_Input(array('required'=>TRUE, 'html_class' => 'ee-billing-qstn ee-billing-qstn-zip', 'html_label_text' => __('Zip', 'event_espresso'))),
36
+				'phone'			=> new EE_Text_Input(array('html_class' => 'ee-billing-qstn ee-billing-qstn-phone', 'html_label_text' => __('Phone', 'event_espresso'))),
37 37
 			),
38
-			isset( $options_array['subsections'] ) ? $options_array['subsections'] : array()
38
+			isset($options_array['subsections']) ? $options_array['subsections'] : array()
39 39
 		);
40 40
 
41
-		parent::__construct( $payment_method, $options_array );
41
+		parent::__construct($payment_method, $options_array);
42 42
 
43 43
 	}
44 44
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 * Sets the defaults for the billing form according to the attendee's details
47 47
 	 * @param EE_Attendee $attendee
48 48
 	 */
49
-	public function populate_from_attendee( $attendee ){
49
+	public function populate_from_attendee($attendee) {
50 50
 		$attendee = EEM_Attendee::instance()->ensure_is_obj($attendee);
51 51
 		/** @var $attendee EE_Attendee */
52 52
 		$this->populate_defaults(array(
@@ -71,48 +71,48 @@  discard block
 block discarded – undo
71 71
 	 * @param \EE_Attendee $attendee - the attendee object to copy details to
72 72
 	 * @return \EE_Attendee
73 73
 	 */
74
-	public function copy_billing_form_data_to_attendee( EE_Attendee $attendee ){
74
+	public function copy_billing_form_data_to_attendee(EE_Attendee $attendee) {
75 75
 		// grab billing form data
76 76
 		$data = $this->valid_data();
77 77
 		// copy first_name
78
-		if ( ! empty( $data['first_name'] )) {
79
-			$attendee->set_fname( $data['first_name'] );
78
+		if ( ! empty($data['first_name'])) {
79
+			$attendee->set_fname($data['first_name']);
80 80
 		}
81 81
 		// copy last_name
82
-		if ( ! empty( $data['last_name'] )) {
83
-			$attendee->set_lname( $data['last_name'] );
82
+		if ( ! empty($data['last_name'])) {
83
+			$attendee->set_lname($data['last_name']);
84 84
 		}
85 85
 		// copy email
86
-		if ( ! empty( $data['email'] )) {
87
-			$attendee->set_email( $data['email'] );
86
+		if ( ! empty($data['email'])) {
87
+			$attendee->set_email($data['email']);
88 88
 		}
89 89
 		// copy address
90
-		if ( ! empty( $data['address'] )) {
91
-			$attendee->set_address( $data['address'] );
90
+		if ( ! empty($data['address'])) {
91
+			$attendee->set_address($data['address']);
92 92
 		}
93 93
 		// copy address2
94
-		if ( ! empty( $data['address2'] )) {
95
-			$attendee->set_address2( $data['address2'] );
94
+		if ( ! empty($data['address2'])) {
95
+			$attendee->set_address2($data['address2']);
96 96
 		}
97 97
 		// copy city
98
-		if ( ! empty( $data['city'] )) {
99
-			$attendee->set_city( $data['city'] );
98
+		if ( ! empty($data['city'])) {
99
+			$attendee->set_city($data['city']);
100 100
 		}
101 101
 		// copy state
102
-		if ( ! empty( $data['state'] )) {
103
-			$attendee->set_state( $data['state'] );
102
+		if ( ! empty($data['state'])) {
103
+			$attendee->set_state($data['state']);
104 104
 		}
105 105
 		// copy country
106
-		if ( ! empty( $data['country'] )) {
107
-			$attendee->set_country( $data['country'] );
106
+		if ( ! empty($data['country'])) {
107
+			$attendee->set_country($data['country']);
108 108
 		}
109 109
 		// copy zip
110
-		if ( ! empty( $data['zip'] )) {
111
-			$attendee->set_zip( $data['zip'] );
110
+		if ( ! empty($data['zip'])) {
111
+			$attendee->set_zip($data['zip']);
112 112
 		}
113 113
 		// copy phone
114
-		if ( ! empty( $data['phone'] )) {
115
-			$attendee->set_phone( $data['phone'] );
114
+		if ( ! empty($data['phone'])) {
115
+			$attendee->set_phone($data['phone']);
116 116
 		}
117 117
 		return $attendee;
118 118
 	}
@@ -123,20 +123,20 @@  discard block
 block discarded – undo
123 123
 	 * uses info from the billing form to create a new attendee
124 124
 	 * @return \EE_Attendee
125 125
 	 */
126
-	public function create_attendee_from_billing_form_data(){
126
+	public function create_attendee_from_billing_form_data() {
127 127
 		// grab billing form data
128 128
 		$data = $this->valid_data();
129
-		return EE_Attendee::new_instance( array(
130
-			'ATT_fname' 		=> ! empty( $data['first_name'] ) ? $data['first_name'] : '',
131
-			'ATT_lname' 		=> ! empty( $data['last_name'] ) ? $data['last_name'] : '',
132
-			'ATT_email' 		=> ! empty( $data['email'] ) ? $data['email'] : '',
133
-			'ATT_address' 		=> ! empty( $data['address'] ) ? $data['address'] : '',
134
-			'ATT_address2' 	=> ! empty( $data['address2'] ) ? $data['address2'] : '',
135
-			'ATT_city' 			=> ! empty( $data['city'] ) ? $data['city'] : '',
136
-			'STA_ID' 				=> ! empty( $data['state'] ) ? $data['state'] : '',
137
-			'CNT_ISO' 			=> ! empty( $data['country'] ) ? $data['country'] : '',
138
-			'ATT_zip' 				=> ! empty( $data['zip'] ) ? $data['zip'] : '',
139
-			'ATT_phone' 		=> ! empty( $data['phone'] ) ? $data['phone'] : '',
129
+		return EE_Attendee::new_instance(array(
130
+			'ATT_fname' 		=> ! empty($data['first_name']) ? $data['first_name'] : '',
131
+			'ATT_lname' 		=> ! empty($data['last_name']) ? $data['last_name'] : '',
132
+			'ATT_email' 		=> ! empty($data['email']) ? $data['email'] : '',
133
+			'ATT_address' 		=> ! empty($data['address']) ? $data['address'] : '',
134
+			'ATT_address2' 	=> ! empty($data['address2']) ? $data['address2'] : '',
135
+			'ATT_city' 			=> ! empty($data['city']) ? $data['city'] : '',
136
+			'STA_ID' 				=> ! empty($data['state']) ? $data['state'] : '',
137
+			'CNT_ISO' 			=> ! empty($data['country']) ? $data['country'] : '',
138
+			'ATT_zip' 				=> ! empty($data['zip']) ? $data['zip'] : '',
139
+			'ATT_phone' 		=> ! empty($data['phone']) ? $data['phone'] : '',
140 140
 		));
141 141
 	}
142 142
 }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -45,6 +45,7 @@
 block discarded – undo
45 45
 	/**
46 46
 	 * Sets the defaults for the billing form according to the attendee's details
47 47
 	 * @param int | \EE_Attendee $attendee
48
+	 * @param EE_Attendee $attendee
48 49
 	 */
49 50
 	public function populate_from_attendee( $attendee ){
50 51
 		$attendee = EEM_Attendee::instance()->ensure_is_obj($attendee);
Please login to merge, or discard this patch.
core/libraries/form_sections/payment_methods/EE_Billing_Info_Form.form.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
 /**
3 3
  *
4 4
  * EE_Billing_Info_Form
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  * @author				Mike Nelson
12 12
  *
13 13
  */
14
-class EE_Billing_Info_Form extends EE_Form_Section_Proper{
14
+class EE_Billing_Info_Form extends EE_Form_Section_Proper {
15 15
 
16 16
 	/**
17 17
 	 * The payment method this billing form is for
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 	 * @param EE_Payment_Method $payment_method
27 27
 	 * @param array $options_array @see EE_Form_Section_Proper::__construct()
28 28
 	 */
29
-	public function __construct( EE_Payment_Method $payment_method, $options_array= array()){
29
+	public function __construct(EE_Payment_Method $payment_method, $options_array = array()) {
30 30
 		$this->_pm_instance = $payment_method;
31 31
 		$this->_layout_strategy = new EE_Div_Per_Section_Layout();
32
-		parent::__construct( $options_array );
32
+		parent::__construct($options_array);
33 33
 
34 34
 	}
35 35
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @param EE_Payment_Method $payment_method
41 41
 	 * @return void
42 42
 	 */
43
-	public function set_payment_method( EE_Payment_Method $payment_method ){
43
+	public function set_payment_method(EE_Payment_Method $payment_method) {
44 44
 		$this->_pm_instance = $payment_method;
45 45
 	}
46 46
 
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 * Returns the instance of the payment method this billing form is for
51 51
 	 * @return EE_Payment_Method
52 52
 	 */
53
-	public function payment_method(){
53
+	public function payment_method() {
54 54
 		return $this->_pm_instance;
55 55
 	}
56 56
 
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 	 * payment_fields_autofilled_notice_html
61 61
 	 * @return string
62 62
 	 */
63
-	public function payment_fields_autofilled_notice_html(){
64
-		EE_Registry::instance()->load_helper( 'HTML' );
63
+	public function payment_fields_autofilled_notice_html() {
64
+		EE_Registry::instance()->load_helper('HTML');
65 65
 		return  new EE_Form_Section_HTML(
66 66
 			EEH_HTML::p(
67
-				apply_filters( 'FHEE__EE_Billing_Info_Form__payment_fields_autofilled_notice_html_text', __( 'Payment fields have been autofilled because you are in debug mode', 'event_espresso' )),
67
+				apply_filters('FHEE__EE_Billing_Info_Form__payment_fields_autofilled_notice_html_text', __('Payment fields have been autofilled because you are in debug mode', 'event_espresso')),
68 68
 				'',
69 69
 				'important-notice'
70 70
 			)
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 	/**
77 77
 	 * @return string
78 78
 	 */
79
-	public function html_class(){
80
-		return ! empty( $this->_html_class ) ? $this->_html_class . ' ee-billing-form' : 'ee-billing-form';
79
+	public function html_class() {
80
+		return ! empty($this->_html_class) ? $this->_html_class.' ee-billing-form' : 'ee-billing-form';
81 81
 	}
82 82
 
83 83
 
Please login to merge, or discard this patch.
libraries/form_sections/strategies/EE_Form_Input_Strategy_Base.strategy.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,14 +3,14 @@  discard block
 block discarded – undo
3 3
  * base class for all strategies which operate on form inputs. Generally, they
4 4
  * all need to know about the form input they are operating on.
5 5
  */
6
-abstract class EE_Form_Input_Strategy_Base{
6
+abstract class EE_Form_Input_Strategy_Base {
7 7
 	/**
8 8
 	 * Form Input to display
9 9
 	 * @var EE_Form_Input_Base
10 10
 	 */
11 11
 	protected $_input;
12 12
 	
13
-	function __construct(){
13
+	function __construct() {
14 14
 		
15 15
 	}
16 16
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * The form input on which this strategy is to perform
19 19
 	 * @param EE_Form_Input_Base $form_input
20 20
 	 */
21
-	function _construct_finalize(EE_Form_Input_Base $form_input){
21
+	function _construct_finalize(EE_Form_Input_Base $form_input) {
22 22
 		$this->_input = $form_input;
23 23
 	}
24 24
 }
25 25
\ No newline at end of file
Please login to merge, or discard this patch.
strategies/display/EE_Admin_File_Uploader_Display_Strategy.strategy.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @since                4.6
9 9
  *
10 10
  */
11
-class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base{
11
+class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base {
12 12
 
13 13
 	/**
14 14
 	 * return EE_Admin_File_Uploader_Display_Strategy
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	 * Besides that, no special consideration should be required to make the media uploader appear, besides having
30 30
 	 * this input displayed.
31 31
 	 */
32
-	static function enqueue_scripts(){
32
+	static function enqueue_scripts() {
33 33
 		wp_enqueue_media();
34 34
 		wp_enqueue_script('media-upload');
35
-		wp_enqueue_script('ee-payments',EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js');
35
+		wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js');
36 36
 	}
37 37
 
38 38
 
@@ -42,20 +42,20 @@  discard block
 block discarded – undo
42 42
 	 * @return string of html to display the field
43 43
 	 */
44 44
 
45
-	function display(){
45
+	function display() {
46 46
 
47
-		EE_Registry::instance()->load_helper( 'HTML' );
47
+		EE_Registry::instance()->load_helper('HTML');
48 48
 		// the actual input
49 49
 		$input = '<input type="text" size="34" ';
50
-		$input .= 'name="' . $this->_input->html_name() . '" ';
51
-		$input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url ' . $this->_input->html_class() . '" ' : 'class="large-text ee_media_url" ';
52
-		$input .= 'value="' . $this->_input->raw_value_in_form() . '">';
50
+		$input .= 'name="'.$this->_input->html_name().'" ';
51
+		$input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url '.$this->_input->html_class().'" ' : 'class="large-text ee_media_url" ';
52
+		$input .= 'value="'.$this->_input->raw_value_in_form().'">';
53 53
 		// image uploader
54
-		$uploader = EEH_HTML::link( '#', '<img src="' . admin_url( 'images/media-button-image.gif' ) . '" >', __( 'click to add an image', 'event_espresso' ), '', 'ee_media_upload' );
54
+		$uploader = EEH_HTML::link('#', '<img src="'.admin_url('images/media-button-image.gif').'" >', __('click to add an image', 'event_espresso'), '', 'ee_media_upload');
55 55
 		//only attempt to show the image if it at least exists
56
-		$image = $this->src_exists( $this->_input->raw_value() ) ? EEH_HTML::br(2) . EEH_HTML::img( $this->_input->raw_value(), __( 'logo', 'event_espresso' ), '', 'ee_media_image' ) : '';
56
+		$image = $this->src_exists($this->_input->raw_value()) ? EEH_HTML::br(2).EEH_HTML::img($this->_input->raw_value(), __('logo', 'event_espresso'), '', 'ee_media_image') : '';
57 57
 		// html string
58
-		return EEH_HTML::div( $input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area' );
58
+		return EEH_HTML::div($input.EEH_HTML::nbsp().$uploader.$image, '', 'ee_media_uploader_area');
59 59
 	}
60 60
 
61 61
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
 	 * @param string $src
67 67
 	 * @return boolean
68 68
 	 */
69
-	protected function src_exists( $src ){
70
-		$results = wp_remote_head( $src );
71
-		if( is_array( $results) && ! $results instanceof WP_Error){
72
-			return strpos($results['headers']['content-type'], "image" ) !== FALSE;
73
-		}else{
69
+	protected function src_exists($src) {
70
+		$results = wp_remote_head($src);
71
+		if (is_array($results) && ! $results instanceof WP_Error) {
72
+			return strpos($results['headers']['content-type'], "image") !== FALSE;
73
+		} else {
74 74
 			return FALSE;
75 75
 		}
76 76
 	}
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/display/EE_Display_Strategy_Base.strategy.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  * @since               	4.6
9 9
  *
10 10
  */
11
-abstract class EE_Display_Strategy_Base extends EE_Form_Input_Strategy_Base{
11
+abstract class EE_Display_Strategy_Base extends EE_Form_Input_Strategy_Base {
12 12
 	/**
13 13
 	 * returns HTML and javascript related to the displaying of this input
14 14
 	 * @return string
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
 	 * @param string $chars - exact string of characters to remove
25 25
 	 * @return string
26 26
 	 */
27
-	protected function _remove_chars( $string = '', $chars = '-' ) {
28
-		$char_length = strlen( $chars ) * -1;
27
+	protected function _remove_chars($string = '', $chars = '-') {
28
+		$char_length = strlen($chars) * -1;
29 29
 		// if last three characters of string is  " - ", then remove it
30
-		return substr( $string, $char_length ) == $chars ? substr( $string, 0, $char_length ) : $string;
30
+		return substr($string, $char_length) == $chars ? substr($string, 0, $char_length) : $string;
31 31
 	}
32 32
 
33 33
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
 	 * @param string $chars - exact string of characters to be added to end of string
40 40
 	 * @return string
41 41
 	 */
42
-	protected function _append_chars( $string = '', $chars = '-' ) {
43
-		return  $this->_remove_chars( $string, $chars ) . $chars;
42
+	protected function _append_chars($string = '', $chars = '-') {
43
+		return  $this->_remove_chars($string, $chars).$chars;
44 44
 	}
45 45
 
46 46
 
Please login to merge, or discard this patch.
form_sections/strategies/display/EE_Hidden_Display_Strategy.strategy.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('No direct script access allowed');
5 5
 
6 6
 /**
@@ -25,12 +25,12 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-class EE_Hidden_Display_Strategy extends EE_Display_Strategy_Base{
28
+class EE_Hidden_Display_Strategy extends EE_Display_Strategy_Base {
29 29
 	/**
30 30
 	 * 
31 31
 	 * @return string of html to display the HIDDEN field
32 32
 	 */
33
-	function display(){
33
+	function display() {
34 34
 		$input = $this->_input;		
35 35
 		return "<input type='hidden' id='{$input->html_id()}' name='{$input->html_name()}' class='{$input->html_class()}' style='{$input->html_style()}' value='{$input->raw_value_in_form()}'/>";
36 36
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if (!defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5
+}
5 6
 /**
6 7
  * Event Espresso
7 8
  *
Please login to merge, or discard this patch.
strategies/display/EE_Radio_Button_Display_Strategy.strategy.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php if (!defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
2 2
 /**
3 3
  *
4 4
  * Class EE_Radio_Button_Display_Strategy
@@ -11,43 +11,43 @@  discard block
 block discarded – undo
11 11
  * @since 				$VID:$
12 12
  *
13 13
  */
14
-class EE_Radio_Button_Display_Strategy extends EE_Display_Strategy_Base{
14
+class EE_Radio_Button_Display_Strategy extends EE_Display_Strategy_Base {
15 15
 
16 16
 	/**
17 17
 	 *
18 18
 	 * @throws EE_Error
19 19
 	 * @return string of html to display the field
20 20
 	 */
21
-	function display(){
22
-		if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base ){
23
-			throw new EE_Error(sprintf(__('Can not use Radio Button Display Strategy with an input that doesn\'t have options', 'event_espresso' )));
21
+	function display() {
22
+		if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) {
23
+			throw new EE_Error(sprintf(__('Can not use Radio Button Display Strategy with an input that doesn\'t have options', 'event_espresso')));
24 24
 		}
25 25
 
26 26
 		$this->_input->set_label_sizes();
27 27
 		$label_size_class = $this->_input->get_label_size_class();
28 28
 		$html = '';
29
-		foreach( $this->_input->options() as $value => $display_text ){
30
-			$value = $this->_input->get_normalization_strategy()->unnormalize( $value );
29
+		foreach ($this->_input->options() as $value => $display_text) {
30
+			$value = $this->_input->get_normalization_strategy()->unnormalize($value);
31 31
 
32
-			$html_id = $this->_append_chars( $this->_input->html_id(), '-' ) . sanitize_key( $value );
33
-			$html .= EEH_HTML::nl( 0, 'radio' );
34
-			$html .= '<label for="' . $html_id . '"';
35
-			$html .= ' id="' . $html_id . '-lbl"';
36
-			$html .= ' class="ee-radio-label-after' . $label_size_class . '">';
37
-			$html .= EEH_HTML::nl( 1, 'radio' );
38
-			$html .= '<input id="' . $html_id . '"';
39
-			$html .= ' name="' . $this->_input->html_name() . '"';
40
-			$html .= ' class="' . $this->_input->html_class() . '"';
41
-			$html .= ' style="' . $this->_input->html_style() . '"';
32
+			$html_id = $this->_append_chars($this->_input->html_id(), '-').sanitize_key($value);
33
+			$html .= EEH_HTML::nl(0, 'radio');
34
+			$html .= '<label for="'.$html_id.'"';
35
+			$html .= ' id="'.$html_id.'-lbl"';
36
+			$html .= ' class="ee-radio-label-after'.$label_size_class.'">';
37
+			$html .= EEH_HTML::nl(1, 'radio');
38
+			$html .= '<input id="'.$html_id.'"';
39
+			$html .= ' name="'.$this->_input->html_name().'"';
40
+			$html .= ' class="'.$this->_input->html_class().'"';
41
+			$html .= ' style="'.$this->_input->html_style().'"';
42 42
 			$html .= ' type="radio"';
43
-			$html .= ' value="' . esc_attr( $value ) . '"';
43
+			$html .= ' value="'.esc_attr($value).'"';
44 44
 			$html .= $this->_input->raw_value() === $value ? ' checked="checked"' : '';
45 45
 			$html .= '>&nbsp;';
46 46
 			$html .= $display_text;
47
-			$html .= EEH_HTML::nl( -1, 'radio' ) . '</label>';
47
+			$html .= EEH_HTML::nl( -1, 'radio' ).'</label>';
48 48
 
49 49
 		}
50
-		$html .= EEH_HTML::div( '', '', 'clear-float' );
50
+		$html .= EEH_HTML::div('', '', 'clear-float');
51 51
 		$html .= EEH_HTML::divx();
52 52
 		return $html;
53 53
 	}
Please login to merge, or discard this patch.
strategies/display/EE_Select_Multiple_Display_Strategy.strategy.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if ( ! defined('EVENT_ESPRESSO_VERSION'))
4 4
 	exit('No direct script access allowed');
5 5
 
6 6
 /**
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * ------------------------------------------------------------------------
27 27
  */
28
-class EE_Select_Multiple_Display_Strategy extends EE_Select_Display_Strategy{
28
+class EE_Select_Multiple_Display_Strategy extends EE_Select_Display_Strategy {
29 29
 
30 30
 	/**
31 31
 	 *
@@ -34,30 +34,30 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public function display() {
36 36
 
37
-		if( ! $this->_input instanceof EE_Form_Input_With_Options_Base){
37
+		if ( ! $this->_input instanceof EE_Form_Input_With_Options_Base) {
38 38
 			throw new EE_Error(sprintf(__('Cannot use Select Multiple Display Strategy with an input that doesn\'t have options', "event_espresso")));
39 39
 		}
40 40
 
41
-		$html = EEH_HTML::nl( 0, 'select' );
41
+		$html = EEH_HTML::nl(0, 'select');
42 42
 		$html .= '<select multiple';
43
-		$html .= ' id="' . $this->_input->html_id() . '"';
44
-		$html .= ' name="' . $this->_input->html_name() . '[]"';
45
-		$class = $this->_input->required() ? $this->_input->required_css_class() . ' ' . $this->_input->html_class() : $this->_input->html_class();
46
-		$html .= ' class="' . $class . '"';
43
+		$html .= ' id="'.$this->_input->html_id().'"';
44
+		$html .= ' name="'.$this->_input->html_name().'[]"';
45
+		$class = $this->_input->required() ? $this->_input->required_css_class().' '.$this->_input->html_class() : $this->_input->html_class();
46
+		$html .= ' class="'.$class.'"';
47 47
 		// add html5 required
48 48
 		$html .= $this->_input->required() ? ' required' : '';
49
-		$html .= ' style="' . $this->_input->html_style() . '"';
49
+		$html .= ' style="'.$this->_input->html_style().'"';
50 50
 		$html .= '>';
51 51
 
52 52
 		EE_Registry::instance()->load_helper('Array');
53
-		EEH_HTML::indent( 1, 'select' );
54
-		if( EEH_Array::is_multi_dimensional_array( $this->_input->options() )){
53
+		EEH_HTML::indent(1, 'select');
54
+		if (EEH_Array::is_multi_dimensional_array($this->_input->options())) {
55 55
 			throw new EE_Error(sprintf(__("Select multiple display strategy does not allow for nested arrays of options.", "event_espresso")));
56
-		}else{
57
-			$html.=$this->_display_options( $this->_input->options() );
56
+		} else {
57
+			$html .= $this->_display_options($this->_input->options());
58 58
 		}
59 59
 
60
-		$html.= EEH_HTML::nl( -1, 'select' ) . "</select>";
60
+		$html .= EEH_HTML::nl( -1, 'select' )."</select>";
61 61
 		return $html;
62 62
 	}
63 63
 
@@ -68,12 +68,12 @@  discard block
 block discarded – undo
68 68
 	 * @param string|int $value unnormalized value option (string)
69 69
 	 * @return boolean
70 70
 	 */
71
-	protected function _check_if_option_selected( $value ){
71
+	protected function _check_if_option_selected($value) {
72 72
 		$selected_options = $this->_input->raw_value();
73
-		if ( empty( $selected_options )){
73
+		if (empty($selected_options)) {
74 74
 			return FALSE;
75 75
 		}
76
-		return in_array( $value, $selected_options ) ? TRUE : FALSE;
76
+		return in_array($value, $selected_options) ? TRUE : FALSE;
77 77
 	}
78 78
 
79 79
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!defined('EVENT_ESPRESSO_VERSION'))
3
+if (!defined('EVENT_ESPRESSO_VERSION')) {
4 4
 	exit('No direct script access allowed');
5
+}
5 6
 
6 7
 /**
7 8
  * Event Espresso
@@ -53,7 +54,7 @@  discard block
 block discarded – undo
53 54
 		EEH_HTML::indent( 1, 'select' );
54 55
 		if( EEH_Array::is_multi_dimensional_array( $this->_input->options() )){
55 56
 			throw new EE_Error(sprintf(__("Select multiple display strategy does not allow for nested arrays of options.", "event_espresso")));
56
-		}else{
57
+		} else{
57 58
 			$html.=$this->_display_options( $this->_input->options() );
58 59
 		}
59 60
 
Please login to merge, or discard this patch.