@@ -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 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('No direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * ------------------------------------------------------------------------ |
26 | 26 | */ |
27 | -class EE_Credit_Card_Month_Input extends EE_Month_Input{ |
|
27 | +class EE_Credit_Card_Month_Input extends EE_Month_Input { |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @param bool $leading_zero |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | $leading_zero = false, |
36 | 36 | $input_settings = array(), |
37 | 37 | $january_is_month_1 = true |
38 | - ){ |
|
39 | - $this->set_sensitive_data_removal_strategy( new EE_All_Sensitive_Data_Removal() ); |
|
38 | + ) { |
|
39 | + $this->set_sensitive_data_removal_strategy(new EE_All_Sensitive_Data_Removal()); |
|
40 | 40 | parent::__construct( |
41 | 41 | $leading_zero, |
42 | 42 | $input_settings, |
@@ -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 |
@@ -6,21 +6,21 @@ discard block |
||
6 | 6 | * @subpackage |
7 | 7 | * @author Mike Nelson |
8 | 8 | */ |
9 | -class EE_Month_Input extends EE_Select_Input{ |
|
9 | +class EE_Month_Input extends EE_Select_Input { |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * @param bool $leading_zero |
13 | 13 | * @param array $input_settings |
14 | 14 | * @param bool $january_is_month_1 whether january should have value of 1; or it should be month 0 |
15 | 15 | */ |
16 | - function __construct( $leading_zero = false, $input_settings = array(), $january_is_month_1 = true){ |
|
16 | + function __construct($leading_zero = false, $input_settings = array(), $january_is_month_1 = true) { |
|
17 | 17 | $key_begin_range = $january_is_month_1 ? 1 : 0; |
18 | - $key_range = range($key_begin_range, $key_begin_range + 11 ); |
|
19 | - if($leading_zero){ |
|
20 | - array_walk( $key_range, array( $this, '_zero_pad' ) ); |
|
18 | + $key_range = range($key_begin_range, $key_begin_range + 11); |
|
19 | + if ($leading_zero) { |
|
20 | + array_walk($key_range, array($this, '_zero_pad')); |
|
21 | 21 | } |
22 | - $value_range = range( 1, 12 ); |
|
23 | - array_walk( $value_range, array( $this, '_zero_pad' ) ); |
|
22 | + $value_range = range(1, 12); |
|
23 | + array_walk($value_range, array($this, '_zero_pad')); |
|
24 | 24 | parent::__construct( |
25 | 25 | array_combine( |
26 | 26 | $key_range, |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @param int $input |
36 | 36 | * @param mixed $key |
37 | 37 | */ |
38 | - protected function _zero_pad( &$input, $key ) { |
|
39 | - $input = str_pad( $input, 2, '0', STR_PAD_LEFT ); |
|
38 | + protected function _zero_pad(&$input, $key) { |
|
39 | + $input = str_pad($input, 2, '0', STR_PAD_LEFT); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | \ No newline at end of file |