@@ -1,6 +1,6 @@ discard block |
||
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,9 +25,9 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_Form_Section_HTML_From_Template extends EE_Form_Section_HTML{ |
|
29 | - public function __construct($template_file,$args = array(), $options_array = array()) { |
|
30 | - $html = EEH_Template::locate_template( $template_file, $args ); |
|
28 | +class EE_Form_Section_HTML_From_Template extends EE_Form_Section_HTML { |
|
29 | + public function __construct($template_file, $args = array(), $options_array = array()) { |
|
30 | + $html = EEH_Template::locate_template($template_file, $args); |
|
31 | 31 | |
32 | 32 | // echo " filepath:$template_file html $html"; |
33 | 33 | parent::__construct($html, $options_array); |
@@ -1,7 +1,8 @@ |
||
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 |
@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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,10 +60,10 @@ discard block |
||
60 | 60 | * payment_fields_autofilled_notice_html |
61 | 61 | * @return string |
62 | 62 | */ |
63 | - public function payment_fields_autofilled_notice_html(){ |
|
63 | + public function payment_fields_autofilled_notice_html() { |
|
64 | 64 | return new EE_Form_Section_HTML( |
65 | 65 | EEH_HTML::p( |
66 | - 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' )), |
|
66 | + 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 | 67 | '', |
68 | 68 | 'important-notice' |
69 | 69 | ) |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | /** |
76 | 76 | * @return string |
77 | 77 | */ |
78 | - public function html_class(){ |
|
79 | - return ! empty( $this->_html_class ) ? $this->_html_class . ' ee-billing-form' : 'ee-billing-form'; |
|
78 | + public function html_class() { |
|
79 | + return ! empty($this->_html_class) ? $this->_html_class.' ee-billing-form' : 'ee-billing-form'; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
4 | - exit( 'No direct script access allowed' ); |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | + exit('No direct script access allowed'); |
|
5 | 5 | } |
6 | 6 | |
7 | 7 | |
@@ -35,24 +35,24 @@ discard block |
||
35 | 35 | $add_wrapper = true |
36 | 36 | ) { |
37 | 37 | // check that incoming object implements the EEI_Address interface |
38 | - if ( ! $obj_with_address instanceof EEI_Address ) { |
|
39 | - $msg = __( 'The address could not be formatted.', 'event_espresso' ); |
|
38 | + if ( ! $obj_with_address instanceof EEI_Address) { |
|
39 | + $msg = __('The address could not be formatted.', 'event_espresso'); |
|
40 | 40 | $dev_msg = __( |
41 | 41 | 'The Address Formatter requires passed objects to implement the EEI_Address interface.', |
42 | 42 | 'event_espresso' |
43 | 43 | ); |
44 | - EE_Error::add_error( $msg . '||' . $dev_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
44 | + EE_Error::add_error($msg.'||'.$dev_msg, __FILE__, __FUNCTION__, __LINE__); |
|
45 | 45 | return null; |
46 | 46 | } |
47 | 47 | // obtain an address formatter |
48 | - $formatter = EEH_Address::_get_formatter( $type ); |
|
48 | + $formatter = EEH_Address::_get_formatter($type); |
|
49 | 49 | // apply schema.org formatting ? |
50 | 50 | $use_schema = ! is_admin() ? $use_schema : false; |
51 | 51 | $formatted_address = $use_schema |
52 | - ? EEH_Address::_schema_formatting( $formatter, $obj_with_address ) |
|
53 | - : EEH_Address::_regular_formatting( $formatter, $obj_with_address, $add_wrapper ); |
|
52 | + ? EEH_Address::_schema_formatting($formatter, $obj_with_address) |
|
53 | + : EEH_Address::_regular_formatting($formatter, $obj_with_address, $add_wrapper); |
|
54 | 54 | $formatted_address = $add_wrapper && ! $use_schema |
55 | - ? '<div class="espresso-address-dv">' . $formatted_address . '</div>' |
|
55 | + ? '<div class="espresso-address-dv">'.$formatted_address.'</div>' |
|
56 | 56 | : $formatted_address; |
57 | 57 | // return the formatted address |
58 | 58 | return $formatted_address; |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | * @param string $type how the address is formatted. for example: 'multiline' or 'inline' |
68 | 68 | * @return EEI_Address_Formatter |
69 | 69 | */ |
70 | - private static function _get_formatter( $type ) { |
|
71 | - switch ( $type ) { |
|
70 | + private static function _get_formatter($type) { |
|
71 | + switch ($type) { |
|
72 | 72 | case 'multiline' : |
73 | 73 | return new EventEspresso\core\services\address\formatters\MultiLineAddressFormatter(); |
74 | 74 | case 'inline' : |
@@ -121,15 +121,15 @@ discard block |
||
121 | 121 | * @param object EEI_Address $obj_with_address |
122 | 122 | * @return string |
123 | 123 | */ |
124 | - private static function _schema_formatting( EEI_Address_Formatter $formatter, EEI_Address $obj_with_address ) { |
|
124 | + private static function _schema_formatting(EEI_Address_Formatter $formatter, EEI_Address $obj_with_address) { |
|
125 | 125 | $formatted_address = '<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">'; |
126 | 126 | $formatted_address .= $formatter->format( |
127 | - EEH_Schema::streetAddress( $obj_with_address ), |
|
128 | - EEH_Schema::postOfficeBoxNumber( $obj_with_address ), |
|
129 | - EEH_Schema::addressLocality( $obj_with_address ), |
|
130 | - EEH_Schema::addressRegion( $obj_with_address ), |
|
131 | - EEH_Schema::postalCode( $obj_with_address ), |
|
132 | - EEH_Schema::addressCountry( $obj_with_address ), |
|
127 | + EEH_Schema::streetAddress($obj_with_address), |
|
128 | + EEH_Schema::postOfficeBoxNumber($obj_with_address), |
|
129 | + EEH_Schema::addressLocality($obj_with_address), |
|
130 | + EEH_Schema::addressRegion($obj_with_address), |
|
131 | + EEH_Schema::postalCode($obj_with_address), |
|
132 | + EEH_Schema::addressCountry($obj_with_address), |
|
133 | 133 | $obj_with_address->country_ID() |
134 | 134 | ); |
135 | 135 | $formatted_address .= '</div>'; |
@@ -39,15 +39,15 @@ discard block |
||
39 | 39 | * @param array $arguments |
40 | 40 | * @return \EE_CPT_Venue_Strategy |
41 | 41 | */ |
42 | - public function __construct( $arguments = array() ) { |
|
43 | - $this->CPT = isset( $arguments['CPT'] ) ? $arguments['CPT'] : NULL; |
|
44 | - $WP_Query = isset( $arguments['WP_Query'] ) ? $arguments['WP_Query'] : NULL; |
|
45 | - if ( $WP_Query instanceof WP_Query && ! $WP_Query->is_tag ) { |
|
46 | - $WP_Query->is_espresso_venue_single = is_singular() && isset( $WP_Query->query->post_type ) && $WP_Query->query->post_type == 'espresso_venues' ? TRUE : FALSE; |
|
42 | + public function __construct($arguments = array()) { |
|
43 | + $this->CPT = isset($arguments['CPT']) ? $arguments['CPT'] : NULL; |
|
44 | + $WP_Query = isset($arguments['WP_Query']) ? $arguments['WP_Query'] : NULL; |
|
45 | + if ($WP_Query instanceof WP_Query && ! $WP_Query->is_tag) { |
|
46 | + $WP_Query->is_espresso_venue_single = is_singular() && isset($WP_Query->query->post_type) && $WP_Query->query->post_type == 'espresso_venues' ? TRUE : FALSE; |
|
47 | 47 | $WP_Query->is_espresso_venue_archive = is_post_type_archive('espresso_venues') ? TRUE : FALSE; |
48 | - $WP_Query->is_espresso_venue_taxonomy = is_tax( 'espresso_venue_categories' ) ? TRUE : FALSE; |
|
48 | + $WP_Query->is_espresso_venue_taxonomy = is_tax('espresso_venue_categories') ? TRUE : FALSE; |
|
49 | 49 | } |
50 | - add_filter( 'the_posts', array( $this, 'the_posts' ), 1, 2 ); |
|
50 | + add_filter('the_posts', array($this, 'the_posts'), 1, 2); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | * @param WP_Query $wp_query |
61 | 61 | * @return void |
62 | 62 | */ |
63 | - public function the_posts( $posts, WP_Query $wp_query) { |
|
63 | + public function the_posts($posts, WP_Query $wp_query) { |
|
64 | 64 | // automagically load the EEH_Venue_View helper so that it's functions are available |
65 | - if ( isset( EE_Registry::instance()->CFG->map_settings->use_google_maps ) && EE_Registry::instance()->CFG->map_settings->use_google_maps ) { |
|
65 | + if (isset(EE_Registry::instance()->CFG->map_settings->use_google_maps) && EE_Registry::instance()->CFG->map_settings->use_google_maps) { |
|
66 | 66 | EEH_Maps::espresso_google_map_js(); |
67 | 67 | } |
68 | - remove_filter( 'the_posts', array( $this, 'the_posts' ), 1, 2 ); |
|
68 | + remove_filter('the_posts', array($this, 'the_posts'), 1, 2); |
|
69 | 69 | return $posts; |
70 | 70 | } |
71 | 71 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\address\formatters; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @param string $CNT_ISO |
29 | 29 | * @return string |
30 | 30 | */ |
31 | - public function format( $address, $address2, $city, $state, $zip, $country, $CNT_ISO ) { |
|
31 | + public function format($address, $address2, $city, $state, $zip, $country, $CNT_ISO) { |
|
32 | 32 | return null; |
33 | 33 | } |
34 | 34 |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\address\formatters; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | // swap address part placeholders for the real text |
42 | 42 | $formatted_address = str_replace( |
43 | 43 | // find |
44 | - array( '{address}', '{address2}', '{city}', '{state}', '{zip}', '{country}' ), |
|
44 | + array('{address}', '{address2}', '{city}', '{state}', '{zip}', '{country}'), |
|
45 | 45 | // replace |
46 | - array( $address, $address2, $city, $state, $zip, $country ), |
|
46 | + array($address, $address2, $city, $state, $zip, $country), |
|
47 | 47 | // string |
48 | 48 | $formatted_address |
49 | 49 | ); |
50 | 50 | // remove placeholder from start and end, reduce repeating placeholders to singles, then replace with HTML line breaks |
51 | - return preg_replace( '/%+/', $sub, trim( $formatted_address, '%' ) ); |
|
51 | + return preg_replace('/%+/', $sub, trim($formatted_address, '%')); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\address\formatters; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @param string $CNT_ISO |
30 | 30 | * @return string |
31 | 31 | */ |
32 | - public function format( $address, $address2, $city, $state, $zip, $country, $CNT_ISO ) { |
|
32 | + public function format($address, $address2, $city, $state, $zip, $country, $CNT_ISO) { |
|
33 | 33 | $address_formats = apply_filters( |
34 | 34 | 'FHEE__EE_MultiLine_Address_Formatter__address_formats', |
35 | 35 | array( |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | ) |
41 | 41 | ); |
42 | 42 | // if the incoming country has a set format, use that, else use the default |
43 | - $formatted_address = isset( $address_formats[ $CNT_ISO ] ) ? $address_formats[ $CNT_ISO ] |
|
43 | + $formatted_address = isset($address_formats[$CNT_ISO]) ? $address_formats[$CNT_ISO] |
|
44 | 44 | : $address_formats['ZZ']; |
45 | 45 | return $this->parse_formatted_address( |
46 | 46 | $address, |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace EventEspresso\core\services\address\formatters; |
3 | 3 | |
4 | -if ( ! defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
5 | - exit( 'No direct script access allowed' ); |
|
4 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
5 | + exit('No direct script access allowed'); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @param string $CNT_ISO |
29 | 29 | * @return string |
30 | 30 | */ |
31 | - public function format( $address, $address2, $city, $state, $zip, $country, $CNT_ISO ) { |
|
31 | + public function format($address, $address2, $city, $state, $zip, $country, $CNT_ISO) { |
|
32 | 32 | $address_formats = apply_filters( |
33 | 33 | 'FHEE__EE_Inline_Address_Formatter__address_formats', |
34 | 34 | array( |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ) |
40 | 40 | ); |
41 | 41 | // if the incoming country has a set format, use that, else use the default |
42 | - $formatted_address = isset( $address_formats[ $CNT_ISO ] ) ? $address_formats[ $CNT_ISO ] |
|
42 | + $formatted_address = isset($address_formats[$CNT_ISO]) ? $address_formats[$CNT_ISO] |
|
43 | 43 | : $address_formats['ZZZ']; |
44 | 44 | return $this->parse_formatted_address( |
45 | 45 | $address, |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * @param boolean $IPN |
34 | 34 | */ |
35 | - public static function set_IPN( $IPN ) { |
|
36 | - self::$IPN = filter_var( $IPN, FILTER_VALIDATE_BOOLEAN ); |
|
35 | + public static function set_IPN($IPN) { |
|
36 | + self::$IPN = filter_var($IPN, FILTER_VALIDATE_BOOLEAN); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | * @param bool $revisit |
45 | 45 | * @return void |
46 | 46 | */ |
47 | - public function set_revisit( $revisit = false ) { |
|
48 | - $this->_revisit = filter_var( $revisit, FILTER_VALIDATE_BOOLEAN ); |
|
47 | + public function set_revisit($revisit = false) { |
|
48 | + $this->_revisit = filter_var($revisit, FILTER_VALIDATE_BOOLEAN); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -60,16 +60,16 @@ discard block |
||
60 | 60 | * @param array $info |
61 | 61 | * @param bool $display_request |
62 | 62 | */ |
63 | - protected function log( $class = '', $func = '', $line = '', EE_Transaction $transaction, $info = array(), $display_request = false ) { |
|
64 | - if ( WP_DEBUG && false ) { |
|
65 | - if ( $transaction instanceof EE_Transaction ) { |
|
63 | + protected function log($class = '', $func = '', $line = '', EE_Transaction $transaction, $info = array(), $display_request = false) { |
|
64 | + if (WP_DEBUG && false) { |
|
65 | + if ($transaction instanceof EE_Transaction) { |
|
66 | 66 | // don't serialize objects |
67 | - $info = EEH_Debug_Tools::strip_objects( $info ); |
|
68 | - if ( $transaction->ID() ) { |
|
69 | - $info[ 'TXN_status' ] = $transaction->status_ID(); |
|
70 | - $info[ 'TXN_reg_steps' ] = $transaction->reg_steps(); |
|
71 | - $index = 'EE_Transaction: ' . $transaction->ID(); |
|
72 | - EEH_Debug_Tools::log( $class, $func, $line, $info, $display_request, $index ); |
|
67 | + $info = EEH_Debug_Tools::strip_objects($info); |
|
68 | + if ($transaction->ID()) { |
|
69 | + $info['TXN_status'] = $transaction->status_ID(); |
|
70 | + $info['TXN_reg_steps'] = $transaction->reg_steps(); |
|
71 | + $index = 'EE_Transaction: '.$transaction->ID(); |
|
72 | + EEH_Debug_Tools::log($class, $func, $line, $info, $display_request, $index); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |