Completed
Branch BUG-10381-asset-loading (7390a7)
by
unknown
39:00 queued 27:53
created
core/services/container/LoadOnlyCoffeeMaker.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 namespace EventEspresso\core\services\container;
3 3
 
4 4
 if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
-    exit('No direct script access allowed');
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -24,26 +24,26 @@  discard block
 block discarded – undo
24 24
 class LoadOnlyCoffeeMaker extends CoffeeMaker
25 25
 {
26 26
 
27
-    /**
28
-     * @return string
29
-     */
30
-    public function type()
31
-    {
32
-        return CoffeeMaker::BREW_LOAD_ONLY;
33
-    }
34
-
35
-
36
-
37
-    /**
38
-     * @param RecipeInterface $recipe
39
-     * @param array           $arguments
40
-     * @return mixed
41
-     */
42
-    public function brew(RecipeInterface $recipe, $arguments = array())
43
-    {
44
-        $this->resolveClassAndFilepath($recipe);
45
-        return null;
46
-    }
27
+	/**
28
+	 * @return string
29
+	 */
30
+	public function type()
31
+	{
32
+		return CoffeeMaker::BREW_LOAD_ONLY;
33
+	}
34
+
35
+
36
+
37
+	/**
38
+	 * @param RecipeInterface $recipe
39
+	 * @param array           $arguments
40
+	 * @return mixed
41
+	 */
42
+	public function brew(RecipeInterface $recipe, $arguments = array())
43
+	{
44
+		$this->resolveClassAndFilepath($recipe);
45
+		return null;
46
+	}
47 47
 
48 48
 
49 49
 
Please login to merge, or discard this patch.
core/services/container/exceptions/InstantiationException.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use BadMethodCallException;
5 5
 
6 6
 if ( ! defined('EVENT_ESPRESSO_VERSION')) {
7
-    exit('No direct script access allowed');
7
+	exit('No direct script access allowed');
8 8
 }
9 9
 
10 10
 
@@ -20,27 +20,27 @@  discard block
 block discarded – undo
20 20
 class InstantiationException extends BadMethodCallException
21 21
 {
22 22
 
23
-    /**
24
-     * InstantiationException constructor.
25
-     *
26
-     * @param string $identifier the name of the requested entity or service
27
-     * @param string     $message
28
-     * @param int        $code
29
-     * @param \Exception $previous
30
-     */
31
-    public function __construct($identifier, $message = '', $code = 0, \Exception $previous = null)
32
-    {
33
-        if (empty($message)) {
34
-            $message = sprintf(
35
-                __(
36
-                    'The "%1$s" class could not be constructed.',
37
-                    'event_espresso'
38
-                ),
39
-                $identifier
40
-            );
41
-        }
42
-        parent::__construct($message, $code, $previous);
43
-    }
23
+	/**
24
+	 * InstantiationException constructor.
25
+	 *
26
+	 * @param string $identifier the name of the requested entity or service
27
+	 * @param string     $message
28
+	 * @param int        $code
29
+	 * @param \Exception $previous
30
+	 */
31
+	public function __construct($identifier, $message = '', $code = 0, \Exception $previous = null)
32
+	{
33
+		if (empty($message)) {
34
+			$message = sprintf(
35
+				__(
36
+					'The "%1$s" class could not be constructed.',
37
+					'event_espresso'
38
+				),
39
+				$identifier
40
+			);
41
+		}
42
+		parent::__construct($message, $code, $previous);
43
+	}
44 44
 
45 45
 }
46 46
 // End of file InstantiationException.php
Please login to merge, or discard this patch.
core/services/container/CoffeePotInterface.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 namespace EventEspresso\core\services\container;
3 3
 
4 4
 if ( ! defined('EVENT_ESPRESSO_VERSION')) {
5
-    exit('No direct script access allowed');
5
+	exit('No direct script access allowed');
6 6
 }
7 7
 
8 8
 
@@ -18,70 +18,70 @@  discard block
 block discarded – undo
18 18
 
19 19
 
20 20
 
21
-    /**
22
-     * returns an instance of the requested entity type using the supplied arguments.
23
-     * If a shared service is requested and an instance is already in the carafe, then it will be returned.
24
-     * If it is not already in the carafe, then the service will be constructed, added to the carafe, and returned
25
-     * If the request is for a new entity and a closure exists in the reservoir for creating it,
26
-     * then a new entity will be instantiated from the closure and returned.
27
-     * If a closure does not exist, then one will be built and added to the reservoir
28
-     * before instantiating the requested entity.
29
-     *
30
-     * @param  string $identifier Identifier for the entity class to be constructed.
31
-     *                            Typically a Fully Qualified Class Name
32
-     * @param array   $arguments  an array of arguments to be passed to the entity constructor
33
-     * @param string  $type
34
-     * @return mixed
35
-     */
36
-    public function brew($identifier, $arguments = array(), $type = '');
21
+	/**
22
+	 * returns an instance of the requested entity type using the supplied arguments.
23
+	 * If a shared service is requested and an instance is already in the carafe, then it will be returned.
24
+	 * If it is not already in the carafe, then the service will be constructed, added to the carafe, and returned
25
+	 * If the request is for a new entity and a closure exists in the reservoir for creating it,
26
+	 * then a new entity will be instantiated from the closure and returned.
27
+	 * If a closure does not exist, then one will be built and added to the reservoir
28
+	 * before instantiating the requested entity.
29
+	 *
30
+	 * @param  string $identifier Identifier for the entity class to be constructed.
31
+	 *                            Typically a Fully Qualified Class Name
32
+	 * @param array   $arguments  an array of arguments to be passed to the entity constructor
33
+	 * @param string  $type
34
+	 * @return mixed
35
+	 */
36
+	public function brew($identifier, $arguments = array(), $type = '');
37 37
 
38 38
 
39 39
 
40
-    /**
41
-     * @param string   $identifier
42
-     * @param callable $closure
43
-     */
44
-    public function addClosure($identifier, $closure);
40
+	/**
41
+	 * @param string   $identifier
42
+	 * @param callable $closure
43
+	 */
44
+	public function addClosure($identifier, $closure);
45 45
 
46 46
 
47 47
 
48
-    /**
49
-     * @param string $identifier
50
-     * @param mixed  $service
51
-     * @return boolean
52
-     */
53
-    public function addService($identifier, $service);
48
+	/**
49
+	 * @param string $identifier
50
+	 * @param mixed  $service
51
+	 * @return boolean
52
+	 */
53
+	public function addService($identifier, $service);
54 54
 
55 55
 
56 56
 
57
-    /**
58
-     * Adds instructions on how to brew objects
59
-     *
60
-     * @param RecipeInterface $recipe
61
-     * @return mixed
62
-     */
63
-    public function addRecipe(RecipeInterface $recipe);
57
+	/**
58
+	 * Adds instructions on how to brew objects
59
+	 *
60
+	 * @param RecipeInterface $recipe
61
+	 * @return mixed
62
+	 */
63
+	public function addRecipe(RecipeInterface $recipe);
64 64
 
65 65
 
66 66
 
67
-    /**
68
-     * Get instructions on how to brew objects
69
-     *
70
-     * @param string $identifier
71
-     * @return Recipe
72
-     */
73
-    public function getRecipe($identifier);
67
+	/**
68
+	 * Get instructions on how to brew objects
69
+	 *
70
+	 * @param string $identifier
71
+	 * @return Recipe
72
+	 */
73
+	public function getRecipe($identifier);
74 74
 
75 75
 
76 76
 
77
-    /**
78
-     * adds class name aliases to list of filters
79
-     *
80
-     * @param  string $identifier
81
-     * @param  array  $aliases
82
-     * @return string
83
-     */
84
-    public function addAliases($identifier, $aliases);
77
+	/**
78
+	 * adds class name aliases to list of filters
79
+	 *
80
+	 * @param  string $identifier
81
+	 * @param  array  $aliases
82
+	 * @return string
83
+	 */
84
+	public function addAliases($identifier, $aliases);
85 85
 
86 86
 
87 87
 
Please login to merge, or discard this patch.
form_sections/strategies/display/EE_Checkbox_Display_Strategy.strategy.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -18,43 +18,43 @@
 block discarded – undo
18 18
 	 * @throws EE_Error
19 19
 	 * @return string of html to display the field
20 20
 	 */
21
-	public function display(){
21
+	public function display() {
22 22
 		$input = $this->get_input();
23 23
 		//d( $input );
24
-		$multi = count( $input->options() ) > 1 ? TRUE : FALSE;
24
+		$multi = count($input->options()) > 1 ? TRUE : FALSE;
25 25
 		$input->set_label_sizes();
26 26
 		$label_size_class = $input->get_label_size_class();
27 27
 		$html = '';
28
-		if ( ! is_array( $input->raw_value() ) && $input->raw_value() !== NULL ) {
28
+		if ( ! is_array($input->raw_value()) && $input->raw_value() !== NULL) {
29 29
 			EE_Error::doing_it_wrong(
30 30
 				'EE_Checkbox_Display_Strategy::display()',
31 31
 				sprintf(
32
-					__( 'Input values for checkboxes should be an array of values, but the value for input "%1$s" is "%2$s". Please verify that the input name is exactly "%3$s"', 'event_espresso'),
32
+					__('Input values for checkboxes should be an array of values, but the value for input "%1$s" is "%2$s". Please verify that the input name is exactly "%3$s"', 'event_espresso'),
33 33
 					$input->html_id(),
34
-					var_export( $input->raw_value(), true),
35
-					$input->html_name() . '[]'
34
+					var_export($input->raw_value(), true),
35
+					$input->html_name().'[]'
36 36
 				),
37 37
 				'4.8.1'
38 38
 			);
39 39
 		}
40
-		$input_raw_value = (array)$input->raw_value();
41
-		foreach( $input->options() as $value => $display_text ){
42
-			$value = $input->get_normalization_strategy()->unnormalize_one( $value );
43
-			$html_id = $this->get_sub_input_id( $value );
44
-			$html .= EEH_HTML::nl( 0, 'checkbox' );
45
-			$html .= '<label for="' . $html_id . '" id="' . $html_id . '-lbl" class="ee-checkbox-label-after' . $label_size_class . '">';
46
-			$html .= EEH_HTML::nl( 1, 'checkbox' );
40
+		$input_raw_value = (array) $input->raw_value();
41
+		foreach ($input->options() as $value => $display_text) {
42
+			$value = $input->get_normalization_strategy()->unnormalize_one($value);
43
+			$html_id = $this->get_sub_input_id($value);
44
+			$html .= EEH_HTML::nl(0, 'checkbox');
45
+			$html .= '<label for="'.$html_id.'" id="'.$html_id.'-lbl" class="ee-checkbox-label-after'.$label_size_class.'">';
46
+			$html .= EEH_HTML::nl(1, 'checkbox');
47 47
 			$html .= '<input type="checkbox"';
48
-			$html .= ' name="' . $input->html_name() . '[]"';
49
-			$html .= ' id="' . $html_id . '"';
50
-			$html .= ' class="' . $input->html_class() . '"';
51
-			$html .= ' style="' . $input->html_style() . '"';
52
-			$html .= ' value="' . esc_attr( $value ) . '"';
53
-			$html .= ! empty( $input_raw_value ) && in_array( $value, $input_raw_value ) ? ' checked="checked"' : '';
54
-			$html .= ' ' . $this->_input->other_html_attributes();
48
+			$html .= ' name="'.$input->html_name().'[]"';
49
+			$html .= ' id="'.$html_id.'"';
50
+			$html .= ' class="'.$input->html_class().'"';
51
+			$html .= ' style="'.$input->html_style().'"';
52
+			$html .= ' value="'.esc_attr($value).'"';
53
+			$html .= ! empty($input_raw_value) && in_array($value, $input_raw_value) ? ' checked="checked"' : '';
54
+			$html .= ' '.$this->_input->other_html_attributes();
55 55
 			$html .= '>&nbsp;';
56 56
 			$html .= $display_text;
57
-			$html .= EEH_HTML::nl( -1, 'checkbox' ) . '</label>';
57
+			$html .= EEH_HTML::nl( -1, 'checkbox' ).'</label>';
58 58
 		}
59 59
 		return $html;
60 60
 	}
Please login to merge, or discard this patch.
core/helpers/EEH_Maps.helper.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -21,18 +21,18 @@  discard block
 block discarded – undo
21 21
 	 * @param  array $ee_gmaps_opts array of attributes required for the map link generation
22 22
 	 * @return string (link to map!)
23 23
 	 */
24
-	public static function google_map( $ee_gmaps_opts ){
25
-
26
-		$ee_map_width = isset( $ee_gmaps_opts['ee_map_width'] ) && ! empty( $ee_gmaps_opts['ee_map_width'] ) ? $ee_gmaps_opts['ee_map_width'] : '300';
27
-		$ee_map_height = isset( $ee_gmaps_opts['ee_map_height'] ) && ! empty( $ee_gmaps_opts['ee_map_height'] ) ? $ee_gmaps_opts['ee_map_height'] : '185';
28
-		$ee_map_zoom = isset( $ee_gmaps_opts['ee_map_zoom'] ) && ! empty( $ee_gmaps_opts['ee_map_zoom'] ) ? $ee_gmaps_opts['ee_map_zoom'] : '12';
29
-		$ee_map_nav_display = isset( $ee_gmaps_opts['ee_map_nav_display'] ) && ! empty( $ee_gmaps_opts['ee_map_nav_display'] ) ? 'true' : 'false';
30
-		$ee_map_nav_size =  isset( $ee_gmaps_opts['ee_map_nav_size'] ) && ! empty( $ee_gmaps_opts['ee_map_nav_size'] )? $ee_gmaps_opts['ee_map_nav_size'] : 'default';
31
-		$ee_map_type_control =  isset( $ee_gmaps_opts['ee_map_type_control'] ) && ! empty( $ee_gmaps_opts['ee_map_type_control'] )? $ee_gmaps_opts['ee_map_type_control'] : 'default';
32
-		$static_url =  isset( $ee_gmaps_opts['ee_static_url'] ) && ! empty( $ee_gmaps_opts['ee_static_url'] )? $ee_gmaps_opts['ee_static_url'] : FALSE;
33
-
34
-		if( isset( $ee_gmaps_opts['ee_map_align'] ) && ! empty( $ee_gmaps_opts['ee_map_align'] )){
35
-			switch( $ee_gmaps_opts['ee_map_align'] ){
24
+	public static function google_map($ee_gmaps_opts) {
25
+
26
+		$ee_map_width = isset($ee_gmaps_opts['ee_map_width']) && ! empty($ee_gmaps_opts['ee_map_width']) ? $ee_gmaps_opts['ee_map_width'] : '300';
27
+		$ee_map_height = isset($ee_gmaps_opts['ee_map_height']) && ! empty($ee_gmaps_opts['ee_map_height']) ? $ee_gmaps_opts['ee_map_height'] : '185';
28
+		$ee_map_zoom = isset($ee_gmaps_opts['ee_map_zoom']) && ! empty($ee_gmaps_opts['ee_map_zoom']) ? $ee_gmaps_opts['ee_map_zoom'] : '12';
29
+		$ee_map_nav_display = isset($ee_gmaps_opts['ee_map_nav_display']) && ! empty($ee_gmaps_opts['ee_map_nav_display']) ? 'true' : 'false';
30
+		$ee_map_nav_size = isset($ee_gmaps_opts['ee_map_nav_size']) && ! empty($ee_gmaps_opts['ee_map_nav_size']) ? $ee_gmaps_opts['ee_map_nav_size'] : 'default';
31
+		$ee_map_type_control = isset($ee_gmaps_opts['ee_map_type_control']) && ! empty($ee_gmaps_opts['ee_map_type_control']) ? $ee_gmaps_opts['ee_map_type_control'] : 'default';
32
+		$static_url = isset($ee_gmaps_opts['ee_static_url']) && ! empty($ee_gmaps_opts['ee_static_url']) ? $ee_gmaps_opts['ee_static_url'] : FALSE;
33
+
34
+		if (isset($ee_gmaps_opts['ee_map_align']) && ! empty($ee_gmaps_opts['ee_map_align'])) {
35
+			switch ($ee_gmaps_opts['ee_map_align']) {
36 36
 				case "left":
37 37
 					$map_align = 'ee-gmap-align-left left';
38 38
 					break;
@@ -53,18 +53,18 @@  discard block
 block discarded – undo
53 53
 
54 54
 		// Determine whether user has set a hardoded url to use and
55 55
 		// if so display a Google static iframe map else run V3 api
56
-		if( $static_url ) {
56
+		if ($static_url) {
57 57
 
58
-			$html = '<div class="ee-gmap-iframewrap ee-gmap-wrapper ' . $map_align . '">';
59
-			$html .= '<iframe src="' . $static_url . '&output=embed" style="width: ' . $ee_map_width  .'px; height: ' . $ee_map_height . 'px;" frameborder="0" scrolling="no">';
58
+			$html = '<div class="ee-gmap-iframewrap ee-gmap-wrapper '.$map_align.'">';
59
+			$html .= '<iframe src="'.$static_url.'&output=embed" style="width: '.$ee_map_width.'px; height: '.$ee_map_height.'px;" frameborder="0" scrolling="no">';
60 60
 			$html .= '</iframe>';
61
-			$html .= '<a href="' . $static_url . '">View Large map</a>';
61
+			$html .= '<a href="'.$static_url.'">View Large map</a>';
62 62
 			$html .= '</div>';
63 63
 			return $html;
64 64
 
65 65
 		 } else {
66 66
 
67
-			EEH_Maps::$gmap_vars[ $ee_gmaps_opts['map_ID'] ] = array(
67
+			EEH_Maps::$gmap_vars[$ee_gmaps_opts['map_ID']] = array(
68 68
 				'map_ID' => $ee_gmaps_opts['map_ID'],
69 69
 				'ee_map_zoom' => $ee_map_zoom,
70 70
 				'ee_map_nav_display' => $ee_map_nav_display,
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
 			);
75 75
 
76 76
 			$html = '<div class="ee-gmap-wrapper '.$map_align.';">';
77
-			$html .= '<div class="ee-gmap" id="map_canvas_' . $ee_gmaps_opts['map_ID'] .'" style="width: '.$ee_map_width.'px; height: '.$ee_map_height.'px;"></div>';  //
77
+			$html .= '<div class="ee-gmap" id="map_canvas_'.$ee_gmaps_opts['map_ID'].'" style="width: '.$ee_map_width.'px; height: '.$ee_map_height.'px;"></div>'; //
78 78
 			$html .= '</div>';
79 79
 
80
-			wp_enqueue_script( 'gmap_api' );
81
-			wp_enqueue_script( 'ee_gmap' );
82
-			add_action( 'wp_footer', array( 'EEH_Maps', 'footer_enqueue_script' ));
80
+			wp_enqueue_script('gmap_api');
81
+			wp_enqueue_script('ee_gmap');
82
+			add_action('wp_footer', array('EEH_Maps', 'footer_enqueue_script'));
83 83
 
84 84
 			return $html;
85 85
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 * @return void
95 95
 	 */
96 96
 	public static function footer_enqueue_script() {
97
-		wp_localize_script( 'ee_gmap', 'ee_gmap_vars', EEH_Maps::$gmap_vars );
97
+		wp_localize_script('ee_gmap', 'ee_gmap_vars', EEH_Maps::$gmap_vars);
98 98
 	}
99 99
 
100 100
 
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
 	public static function espresso_google_map_js() {
106 106
 		$api_url = sprintf(
107 107
 			"https://maps.googleapis.com/maps/api/js?key=%s",
108
-			apply_filters( 'FHEE__EEH_Maps__espresso_google_maps_js__api_key', EE_Registry::instance()->CFG->map_settings->google_map_api_key )
108
+			apply_filters('FHEE__EEH_Maps__espresso_google_maps_js__api_key', EE_Registry::instance()->CFG->map_settings->google_map_api_key)
109 109
 		);
110
-		wp_register_script( 'gmap_api', $api_url, array('jquery'), NULL, TRUE );
111
-		wp_register_script( 'ee_gmap', plugin_dir_url(__FILE__) . 'assets/ee_gmap.js', array('gmap_api'), '1.0', TRUE );
110
+		wp_register_script('gmap_api', $api_url, array('jquery'), NULL, TRUE);
111
+		wp_register_script('ee_gmap', plugin_dir_url(__FILE__).'assets/ee_gmap.js', array('gmap_api'), '1.0', TRUE);
112 112
 	}
113 113
 
114 114
 	/**
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * @return string (link to map!)
118 118
 	 */
119 119
 	public static function google_map_link($atts) {
120
-		do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' );
120
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
121 121
 		extract($atts);
122 122
 		/** @var string $address */
123 123
 		/** @var string $city */
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
 		$id = isset($id) ? $id : 'not_set';
137 137
 		$map_image_class = isset($map_image_class) ? $map_image_class : 'ee_google_map_view';
138 138
 
139
-		$address_string = ($address != '' ? $address : '') . ($city != '' ? ',' . $city : '') . ($state != '' ? ',' . $state : '') . ($zip != '' ? ',' . $zip : '') . ($country != '' ? ',' . $country : '');
139
+		$address_string = ($address != '' ? $address : '').($city != '' ? ','.$city : '').($state != '' ? ','.$state : '').($zip != '' ? ','.$zip : '').($country != '' ? ','.$country : '');
140 140
 
141
-		$google_map = htmlentities2('http://maps.google.com/maps?q=' . urlencode( $address_string ));
141
+		$google_map = htmlentities2('http://maps.google.com/maps?q='.urlencode($address_string));
142 142
 
143 143
 		switch ($type) {
144 144
 			case 'text':
@@ -153,12 +153,12 @@  discard block
 block discarded – undo
153 153
 			case 'map':
154 154
 				$scheme = is_ssl() ? 'https://' : 'http://';
155 155
 
156
-				$api_key = apply_filters( 'FHEE__EEH_Maps__espresso_google_maps_link__api_key', EE_Registry::instance()->CFG->map_settings->google_map_api_key );
156
+				$api_key = apply_filters('FHEE__EEH_Maps__espresso_google_maps_link__api_key', EE_Registry::instance()->CFG->map_settings->google_map_api_key);
157 157
 
158
-				return '<a class="a_map_image_link" href="' . $google_map . '" target="_blank">' . '<img class="map_image_link" id="venue_map_' . $id . '" ' . $map_image_class . ' src="' . htmlentities2( $scheme . 'maps.googleapis.com/maps/api/staticmap?center=' . urlencode( $address_string ) . '&amp;zoom=14&amp;size=' . $map_w . 'x' . $map_h . '&amp;markers=color:green|label:|' . urlencode( $address_string ) . '&amp;sensor=false&amp;key=' . $api_key ) . '" /></a>';
158
+				return '<a class="a_map_image_link" href="'.$google_map.'" target="_blank">'.'<img class="map_image_link" id="venue_map_'.$id.'" '.$map_image_class.' src="'.htmlentities2($scheme.'maps.googleapis.com/maps/api/staticmap?center='.urlencode($address_string).'&amp;zoom=14&amp;size='.$map_w.'x'.$map_h.'&amp;markers=color:green|label:|'.urlencode($address_string).'&amp;sensor=false&amp;key='.$api_key).'" /></a>';
159 159
 		}
160 160
 
161
-		return '<a href="' . $google_map . '" target="_blank">' . $text . '</a>';
161
+		return '<a href="'.$google_map.'" target="_blank">'.$text.'</a>';
162 162
 	}
163 163
 
164 164
 
Please login to merge, or discard this patch.
admin_pages/venues/templates/google_map.template.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,12 +26,12 @@
 block discarded – undo
26 26
                     <input type="text" id="ee-google-map-api-key" class="regular-text" name="google_map_api_key" value="<?php echo $map_settings->google_map_api_key; ?>" />
27 27
                     <p class="description">
28 28
                         <?php
29
-                            printf(
30
-                                __('An API key is now required to use the Google Maps API: %1$sclick here to get an API key%2$s', 'event_espresso'),
31
-                                '<a href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend,static_maps_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank">',
32
-                                '</a>'
33
-                            );
34
-                        ?>
29
+							printf(
30
+								__('An API key is now required to use the Google Maps API: %1$sclick here to get an API key%2$s', 'event_espresso'),
31
+								'<a href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend,static_maps_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank">',
32
+								'</a>'
33
+							);
34
+						?>
35 35
                     </p>
36 36
                 </td>
37 37
             </tr>
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 				</td>
16 16
 			</tr>
17 17
 			<?php
18
-			if( apply_filters( 'FHEE__google_map__show_api_key_input', true ) ) { ?>
18
+			if (apply_filters('FHEE__google_map__show_api_key_input', true)) { ?>
19 19
             <tr>
20 20
                 <th>
21 21
                     <label for="ee-google-map-api-key">
@@ -110,19 +110,19 @@  discard block
 block discarded – undo
110 110
 				<td>
111 111
 					<label for="event_details_control_type-default" class="ee-admin-radio-lbl">
112 112
 						<?php $checked = $map_settings->event_details_control_type == 'default' ? 'checked="checked"' : ''; ?>
113
-						<input id="event_details_control_type-default" type="radio" name="event_details_control_type" value="default"<?php echo $checked;?>/>
113
+						<input id="event_details_control_type-default" type="radio" name="event_details_control_type" value="default"<?php echo $checked; ?>/>
114 114
 						<?php _e(' Default', 'event_espresso') ?>
115 115
 					</label>
116 116
 
117 117
 					<label for="event_details_control_type-horizontal" class="ee-admin-radio-lbl">
118 118
 						<?php $checked = $map_settings->event_details_control_type == 'horizontal' ? 'checked="checked"' : ''; ?>
119
-						<input id="event_details_control_type-horizontal" type="radio" name="event_details_control_type" value="horizontal"<?php echo $checked;?>/>
119
+						<input id="event_details_control_type-horizontal" type="radio" name="event_details_control_type" value="horizontal"<?php echo $checked; ?>/>
120 120
 						<?php _e(' Horizontal', 'event_espresso') ?>
121 121
 					</label>
122 122
 
123 123
 					<label for="event_details_control_type-dropdown" class="ee-admin-radio-lbl">
124 124
 						<?php $checked = $map_settings->event_details_control_type == 'dropdown' ? 'checked="checked"' : ''; ?>
125
-						<input id="event_details_control_type-dropdown" type="radio" name="event_details_control_type" value="dropdown"<?php echo $checked;?>/>
125
+						<input id="event_details_control_type-dropdown" type="radio" name="event_details_control_type" value="dropdown"<?php echo $checked; ?>/>
126 126
 						<?php _e(' Dropdown', 'event_espresso') ?>
127 127
 					</label>
128 128
 				</td>
@@ -135,25 +135,25 @@  discard block
 block discarded – undo
135 135
 				<td>
136 136
 					<label for="event_details_map_align-none" class="ee-admin-radio-lbl">
137 137
 						<?php $checked = $map_settings->event_details_map_align == 'none' ? 'checked="checked"' : ''; ?>
138
-						<input id="event_details_map_align-none" type="radio" name="event_details_map_align" value="none"<?php echo $checked;?>/>
138
+						<input id="event_details_map_align-none" type="radio" name="event_details_map_align" value="none"<?php echo $checked; ?>/>
139 139
 						<?php _e(' None', 'event_espresso') ?>
140 140
 					</label>
141 141
 
142 142
 					<label for="event_details_map_align-left" class="ee-admin-radio-lbl">
143 143
 						<?php $checked = $map_settings->event_details_map_align == 'left' ? 'checked="checked"' : ''; ?>
144
-						<input id="event_details_map_align-left" type="radio" name="event_details_map_align" value="left"<?php echo $checked;?>/>
144
+						<input id="event_details_map_align-left" type="radio" name="event_details_map_align" value="left"<?php echo $checked; ?>/>
145 145
 						<?php _e(' Align Left', 'event_espresso') ?>
146 146
 					</label>
147 147
 
148 148
 					<label for="event_details_map_align-center" class="ee-admin-radio-lbl">
149 149
 						<?php $checked = $map_settings->event_details_map_align == 'center' ? 'checked="checked"' : ''; ?>
150
-						<input id="event_details_map_align-center" type="radio" name="event_details_map_align" value="center"<?php echo $checked;?>/>
150
+						<input id="event_details_map_align-center" type="radio" name="event_details_map_align" value="center"<?php echo $checked; ?>/>
151 151
 						<?php _e(' Align Center', 'event_espresso') ?>
152 152
 					</label>
153 153
 
154 154
 					<label for="event_details_map_align-right" class="ee-admin-radio-lbl">
155 155
 						<?php $checked = $map_settings->event_details_map_align == 'right' ? 'checked="checked"' : ''; ?>
156
-						<input id="event_details_map_align-right" type="radio" name="event_details_map_align" value="right"<?php echo $checked;?>/>
156
+						<input id="event_details_map_align-right" type="radio" name="event_details_map_align" value="right"<?php echo $checked; ?>/>
157 157
 						<?php _e(' Align Right', 'event_espresso') ?>
158 158
 					</label>
159 159
 				</td>
@@ -228,19 +228,19 @@  discard block
 block discarded – undo
228 228
 				<td>
229 229
 					<label for="event_list_control_type-default" class="ee-admin-radio-lbl">
230 230
 						<?php $checked = $map_settings->event_list_control_type == 'default' ? 'checked="checked"' : ''; ?>
231
-						<input id="event_list_control_type-default" type="radio" name="event_list_control_type" value="default"<?php echo $checked;?>/>
231
+						<input id="event_list_control_type-default" type="radio" name="event_list_control_type" value="default"<?php echo $checked; ?>/>
232 232
 						<?php _e(' Default', 'event_espresso') ?>
233 233
 					</label>
234 234
 
235 235
 					<label for="event_list_control_type-horizontal" class="ee-admin-radio-lbl">
236 236
 						<?php $checked = $map_settings->event_list_control_type == 'horizontal' ? 'checked="checked"' : ''; ?>
237
-						<input id="event_list_control_type-horizontal" type="radio" name="event_list_control_type" value="horizontal"<?php echo $checked;?>/>
237
+						<input id="event_list_control_type-horizontal" type="radio" name="event_list_control_type" value="horizontal"<?php echo $checked; ?>/>
238 238
 						<?php _e(' Horizontal', 'event_espresso') ?>
239 239
 					</label>
240 240
 
241 241
 					<label for="event_list_control_type-dropdown" class="ee-admin-radio-lbl">
242 242
 						<?php $checked = $map_settings->event_list_control_type == 'dropdown' ? 'checked="checked"' : ''; ?>
243
-						<input id="event_list_control_type-dropdown" type="radio" name="event_list_control_type" value="dropdown"<?php echo $checked;?>/>
243
+						<input id="event_list_control_type-dropdown" type="radio" name="event_list_control_type" value="dropdown"<?php echo $checked; ?>/>
244 244
 						<?php _e(' Dropdown', 'event_espresso') ?>
245 245
 					</label>
246 246
 
@@ -254,25 +254,25 @@  discard block
 block discarded – undo
254 254
 				<td>
255 255
 					<label for="event_list_map_align-none" class="ee-admin-radio-lbl">
256 256
 						<?php $checked = $map_settings->event_list_map_align == 'none' ? 'checked="checked"' : ''; ?>
257
-						<input id="event_list_map_align-none" type="radio" name="event_list_map_align" value="none"<?php echo $checked;?>/>
257
+						<input id="event_list_map_align-none" type="radio" name="event_list_map_align" value="none"<?php echo $checked; ?>/>
258 258
 						<?php _e(' None', 'event_espresso') ?>
259 259
 					</label>
260 260
 
261 261
 					<label for="event_list_map_align-left" class="ee-admin-radio-lbl">
262 262
 						<?php $checked = $map_settings->event_list_map_align == 'left' ? 'checked="checked"' : ''; ?>
263
-						<input id="event_list_map_align-left" type="radio" name="event_list_map_align" value="left"<?php echo $checked;?>/>
263
+						<input id="event_list_map_align-left" type="radio" name="event_list_map_align" value="left"<?php echo $checked; ?>/>
264 264
 						<?php _e(' Align Left', 'event_espresso') ?>
265 265
 					</label>
266 266
 
267 267
 					<label for="event_list_map_align-center" class="ee-admin-radio-lbl">
268 268
 						<?php $checked = $map_settings->event_list_map_align == 'center' ? 'checked="checked"' : ''; ?>
269
-						<input id="event_list_map_align-center" type="radio" name="event_list_map_align" value="center"<?php echo $checked;?>/>
269
+						<input id="event_list_map_align-center" type="radio" name="event_list_map_align" value="center"<?php echo $checked; ?>/>
270 270
 						<?php _e(' Align Center', 'event_espresso') ?>
271 271
 					</label>
272 272
 
273 273
 					<label for="event_list_map_align-right" class="ee-admin-radio-lbl">
274 274
 						<?php $checked = $map_settings->event_list_map_align == 'right' ? 'checked="checked"' : ''; ?>
275
-						<input id="event_list_map_align-right" type="radio" name="event_list_map_align" value="right"<?php echo $checked;?>/>
275
+						<input id="event_list_map_align-right" type="radio" name="event_list_map_align" value="right"<?php echo $checked; ?>/>
276 276
 						<?php _e(' Align Right', 'event_espresso') ?>
277 277
 					</label>
278 278
 
Please login to merge, or discard this patch.
caffeinated/payment_methods/Paypal_Pro/EE_PMT_Paypal_Pro.pm.php 2 patches
Spacing   +30 added lines, -30 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_PMT_Paypal_Pro extends EE_PMT_Base{
28
+class EE_PMT_Paypal_Pro extends EE_PMT_Base {
29 29
 
30 30
 	/**
31 31
 	 * @param EE_Payment_Method $pm_instance
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 		require_once($this->file_folder().'EEG_Paypal_Pro.gateway.php');
36 36
 		$this->_gateway = new EEG_Paypal_Pro();
37 37
 		$this->_pretty_name = __("Paypal Pro", 'event_espresso');
38
-		$this->_default_description = __( 'Please provide the following billing information.', 'event_espresso' );
38
+		$this->_default_description = __('Please provide the following billing information.', 'event_espresso');
39 39
 		$this->_requires_https = true;
40 40
 		parent::__construct($pm_instance);
41 41
 	}
@@ -51,21 +51,21 @@  discard block
 block discarded – undo
51 51
 			'extra_meta_inputs'=>array(
52 52
 //				'paypal_email'=>new EE_Email_Input(), not actually used
53 53
 				'username'=>new EE_Text_Input(array(
54
-					'html_label_text'=>  sprintf(__("Paypal API Username %s", "event_espresso"),$this->get_help_tab_link()),
54
+					'html_label_text'=>  sprintf(__("Paypal API Username %s", "event_espresso"), $this->get_help_tab_link()),
55 55
 					'required' => true
56 56
 				)),
57 57
 				'password'=>new EE_Text_Input(array(
58
-					'html_label_text'=>  sprintf(__("Paypal API Password %s", "event_espresso"),$this->get_help_tab_link()),
58
+					'html_label_text'=>  sprintf(__("Paypal API Password %s", "event_espresso"), $this->get_help_tab_link()),
59 59
 					'required' => true
60 60
 				)),
61 61
 				'signature'=>new EE_Text_Input(array(
62
-					'html_label_text'=>  sprintf(__("Paypal API Signature %s", "event_espresso"),$this->get_help_tab_link()),
62
+					'html_label_text'=>  sprintf(__("Paypal API Signature %s", "event_espresso"), $this->get_help_tab_link()),
63 63
 					'required' => true
64 64
 				)),
65 65
 				'credit_card_types'=>new EE_Checkbox_Multi_Input(
66 66
 						$this->card_types_supported(),
67 67
 						array(
68
-							'html_label_text' => __( 'Card Types Supported', 'event_espresso' ),
68
+							'html_label_text' => __('Card Types Supported', 'event_espresso'),
69 69
 							'required' => true )),
70 70
 				)
71 71
 			)
@@ -79,10 +79,10 @@  discard block
 block discarded – undo
79 79
 	 * @throws \EE_Error
80 80
 	 * @return EE_Billing_Info_Form
81 81
 	 */
82
-	public function generate_new_billing_form( EE_Transaction $transaction = NULL ) {
83
-		$allowed_types = $this->_pm_instance->get_extra_meta( 'credit_card_types', TRUE );
82
+	public function generate_new_billing_form(EE_Transaction $transaction = NULL) {
83
+		$allowed_types = $this->_pm_instance->get_extra_meta('credit_card_types', TRUE);
84 84
 		//if allowed types is a string or empty array or null...
85
-		if( empty( $allowed_types )) {
85
+		if (empty($allowed_types)) {
86 86
 			$allowed_types = array();
87 87
 		}
88 88
 
@@ -93,26 +93,26 @@  discard block
 block discarded – undo
93 93
 //				'html_id'=> 'ee-Paypal_Pro-billing-form',
94 94
 				'subsections'=>array(
95 95
 					'credit_card'=>new EE_Credit_Card_Input(
96
-						array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __( 'Card Number', 'event_espresso' ))
96
+						array('required'=>TRUE, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Card Number', 'event_espresso'))
97 97
 					),
98 98
 					'credit_card_type'=>new EE_Select_Input(
99 99
 						//the options are set dynamically
100
-						array_intersect_key( EE_PMT_Paypal_Pro::card_types_supported(), array_flip( $allowed_types )),
101
-						array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __( 'Card Type', 'event_espresso' ))
100
+						array_intersect_key(EE_PMT_Paypal_Pro::card_types_supported(), array_flip($allowed_types)),
101
+						array('required'=>TRUE, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Card Type', 'event_espresso'))
102 102
 					),
103 103
 					'exp_month'=>new EE_Credit_Card_Month_Input(
104
-						TRUE, array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn', 'html_label_text' =>  __( 'Expiry Month', 'event_espresso' )  )
104
+						TRUE, array('required'=>TRUE, 'html_class' => 'ee-billing-qstn', 'html_label_text' =>  __('Expiry Month', 'event_espresso'))
105 105
 					),
106 106
 					'exp_year'=>new EE_Credit_Card_Year_Input(
107
-						array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __( 'Expiry Year', 'event_espresso' )  )
107
+						array('required'=>TRUE, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('Expiry Year', 'event_espresso'))
108 108
 					),
109 109
 					'cvv'=>new EE_CVV_Input(
110
-						array( 'required'=>TRUE, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __( 'CVV', 'event_espresso' ) )
110
+						array('required'=>TRUE, 'html_class' => 'ee-billing-qstn', 'html_label_text' => __('CVV', 'event_espresso'))
111 111
 					),
112 112
 				)
113 113
 			)
114 114
 		);
115
-		return $this->apply_billing_form_debug_settings( $billing_form );
115
+		return $this->apply_billing_form_debug_settings($billing_form);
116 116
 	}
117 117
 
118 118
 
@@ -124,19 +124,19 @@  discard block
 block discarded – undo
124 124
 	 * @param \EE_Billing_Info_Form $billing_form
125 125
 	 * @return \EE_Billing_Info_Form
126 126
 	 */
127
-	public function apply_billing_form_debug_settings( EE_Billing_Info_Form $billing_form ) {
128
-		if ( $this->_pm_instance->debug_mode() ) {
127
+	public function apply_billing_form_debug_settings(EE_Billing_Info_Form $billing_form) {
128
+		if ($this->_pm_instance->debug_mode()) {
129 129
 			$billing_form->add_subsections(
130
-				array( 'fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html() ),
130
+				array('fyi_about_autofill' => $billing_form->payment_fields_autofilled_notice_html()),
131 131
 				'credit_card'
132 132
 			);
133 133
 			$billing_form->add_subsections(
134
-				array( 'debug_content' => new EE_Form_Section_HTML_From_Template( dirname(__FILE__).DS.'templates'.DS.'paypal_pro_debug_info.template.php' )),
134
+				array('debug_content' => new EE_Form_Section_HTML_From_Template(dirname(__FILE__).DS.'templates'.DS.'paypal_pro_debug_info.template.php')),
135 135
 				'first_name'
136 136
 			);
137
-			$billing_form->get_input( 'credit_card_type' )->set_default( 'Visa' );
138
-			$billing_form->get_input( 'exp_year' )->set_default( 2018);
139
-			$billing_form->get_input( 'cvv' )->set_default( '115' );
137
+			$billing_form->get_input('credit_card_type')->set_default('Visa');
138
+			$billing_form->get_input('exp_year')->set_default(2018);
139
+			$billing_form->get_input('cvv')->set_default('115');
140 140
 		}
141 141
 		return $billing_form;
142 142
 	}
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 * Keys are their values, values are their pretty names.
149 149
 	 * @return array
150 150
 	 */
151
-	public static function card_types_supported(){
151
+	public static function card_types_supported() {
152 152
 		return array(
153 153
 			'Visa'=>  __("Visa", 'event_espresso'),
154 154
 			'MasterCard'=>  __("MasterCard", 'event_espresso'),
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 	 * @see EE_PMT_Base::help_tabs_config()
165 165
 	 * @return array
166 166
 	 */
167
-	public function help_tabs_config(){
167
+	public function help_tabs_config() {
168 168
 		return array(
169 169
 			$this->get_help_tab_name() => array(
170 170
 						'title' => __('PayPal Pro Settings', 'event_espresso'),
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
 	 * @param EE_Billing_Info_Form $billing_form
180 180
 	 * @return array
181 181
 	 */
182
-	protected function _get_billing_values_from_form( $billing_form ){
183
-		$billing_values = parent::_get_billing_values_from_form( $billing_form );
184
-		$billing_values[ 'country' ] = $billing_form->get_input_value( 'country' );
185
-		$billing_values[ 'credit_card_type' ] = $billing_form->get_input_value( 'credit_card_type' );
182
+	protected function _get_billing_values_from_form($billing_form) {
183
+		$billing_values = parent::_get_billing_values_from_form($billing_form);
184
+		$billing_values['country'] = $billing_form->get_input_value('country');
185
+		$billing_values['credit_card_type'] = $billing_form->get_input_value('credit_card_type');
186 186
 		return $billing_values;
187 187
 	}
188 188
 
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
 /**
7 8
  * Event Espresso
Please login to merge, or discard this patch.
core/business/EE_Registration_Processor.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -565,7 +565,7 @@
 block discarded – undo
565 565
 	 * @since 4.9.1
566 566
 	 * @param int                   $att_nmbr
567 567
 	 * @param EE_Line_Item | string $item
568
-	 * @return string
568
+	 * @return RegUrlLink
569 569
 	 */
570 570
 	public function generate_reg_url_link($att_nmbr, $item)
571 571
 	{
Please login to merge, or discard this patch.
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 			}
216 216
 			// don't trigger notifications during IPNs because they will get triggered by EE_Payment_Processor
217 217
 			if ( ! EE_Processor_Base::$IPN ) {
218
-                // otherwise, send out notifications
218
+				// otherwise, send out notifications
219 219
 				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
220 220
 			}
221 221
 			// DEBUG LOG
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 			}
263 263
 			// don't trigger notifications during IPNs because they will get triggered by EE_Payment_Processor
264 264
 			if ( ! EE_Processor_Base::$IPN ) {
265
-                // otherwise, send out notifications
265
+				// otherwise, send out notifications
266 266
 				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
267 267
 			}
268 268
 			// DEBUG LOG
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 			}
350 350
 			// don't trigger notifications during IPNs because they will get triggered by EE_Payment_Processor
351 351
 			if ( ! EE_Processor_Base::$IPN ) {
352
-                // otherwise, send out notifications
352
+				// otherwise, send out notifications
353 353
 				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
354 354
 			}
355 355
 			// DEBUG LOG
@@ -390,10 +390,10 @@  discard block
 block discarded – undo
390 390
 			// 	false,
391 391
 			// 	'EE_Transaction: ' . $registration->transaction()->ID()
392 392
 			// );
393
-            if ( ! $registration->is_primary_registrant()) {
394
-                return;
395
-            }
396
-            do_action(
393
+			if ( ! $registration->is_primary_registrant()) {
394
+				return;
395
+			}
396
+			do_action(
397 397
 				'AHEE__EE_Registration_Processor__trigger_registration_update_notifications',
398 398
 				$registration,
399 399
 				$additional_details
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 		// set new  REG_Status
429 429
 		$this->set_new_reg_status( $registration->ID(), $registration->status_ID() );
430 430
 		return $this->reg_status_updated( $registration->ID() )
431
-		       && $this->new_reg_status( $registration->ID() ) === EEM_Registration::status_id_approved
431
+			   && $this->new_reg_status( $registration->ID() ) === EEM_Registration::status_id_approved
432 432
 			? true
433 433
 			: false;
434 434
 	}
@@ -508,15 +508,15 @@  discard block
 block discarded – undo
508 508
 
509 509
 
510 510
 
511
-    /**
512
-     * update_registration_after_being_canceled_or_declined
513
-     *
514
-     * @param \EE_Registration $registration
515
-     * @param array            $closed_reg_statuses
516
-     * @param bool             $update_reg
517
-     * @return bool
518
-     * @throws \EE_Error
519
-     */
511
+	/**
512
+	 * update_registration_after_being_canceled_or_declined
513
+	 *
514
+	 * @param \EE_Registration $registration
515
+	 * @param array            $closed_reg_statuses
516
+	 * @param bool             $update_reg
517
+	 * @return bool
518
+	 * @throws \EE_Error
519
+	 */
520 520
 	public function update_registration_after_being_canceled_or_declined(
521 521
 		EE_Registration $registration,
522 522
 		$closed_reg_statuses = array(),
@@ -524,14 +524,14 @@  discard block
 block discarded – undo
524 524
 	) {
525 525
 		// these reg statuses should not be considered in any calculations involving monies owing
526 526
 		$closed_reg_statuses = ! empty( $closed_reg_statuses )
527
-            ? $closed_reg_statuses
527
+			? $closed_reg_statuses
528 528
 			: EEM_Registration::closed_reg_statuses();
529 529
 		if ( ! in_array( $registration->status_ID(), $closed_reg_statuses, true ) ) {
530 530
 			return false;
531 531
 		}
532
-        // release a reserved ticket by decrementing ticket and datetime reserved values
533
-        $registration->release_reserved_ticket(true);
534
-        $registration->set_final_price(0);
532
+		// release a reserved ticket by decrementing ticket and datetime reserved values
533
+		$registration->release_reserved_ticket(true);
534
+		$registration->set_final_price(0);
535 535
 		if ( $update_reg ) {
536 536
 			$registration->save();
537 537
 		}
Please login to merge, or discard this patch.
Spacing   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@  discard block
 block discarded – undo
3 3
 use EventEspresso\core\domain\entities\RegUrlLink;
4 4
 use EventEspresso\core\domain\services\registration\CreateRegistrationService;
5 5
 
6
-if ( ! defined( 'EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
7
-EE_Registry::instance()->load_class( 'Processor_Base' );
6
+if ( ! defined('EVENT_ESPRESSO_VERSION')) { exit('No direct script access allowed'); }
7
+EE_Registry::instance()->load_class('Processor_Base');
8 8
 
9 9
 /**
10 10
  * Class EE_Registration_Processor
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 */
67 67
 	public static function instance() {
68 68
 		// check if class object is instantiated
69
-		if ( ! self::$_instance instanceof EE_Registration_Processor ) {
69
+		if ( ! self::$_instance instanceof EE_Registration_Processor) {
70 70
 			self::$_instance = new self();
71 71
 		}
72 72
 		return self::$_instance;
@@ -86,8 +86,8 @@  discard block
 block discarded – undo
86 86
 	 * @param int $REG_ID
87 87
 	 * @return string
88 88
 	 */
89
-	public function old_reg_status( $REG_ID ) {
90
-		return isset( $this->_old_reg_status[ $REG_ID ] ) ? $this->_old_reg_status[ $REG_ID ] : null;
89
+	public function old_reg_status($REG_ID) {
90
+		return isset($this->_old_reg_status[$REG_ID]) ? $this->_old_reg_status[$REG_ID] : null;
91 91
 	}
92 92
 
93 93
 
@@ -96,10 +96,10 @@  discard block
 block discarded – undo
96 96
 	 * @param int $REG_ID
97 97
 	 * @param string $old_reg_status
98 98
 	 */
99
-	public function set_old_reg_status( $REG_ID, $old_reg_status ) {
99
+	public function set_old_reg_status($REG_ID, $old_reg_status) {
100 100
 		// only set the first time
101
-		if ( ! isset( $this->_old_reg_status[ $REG_ID ] ) ) {
102
-			$this->_old_reg_status[ $REG_ID ] = $old_reg_status;
101
+		if ( ! isset($this->_old_reg_status[$REG_ID])) {
102
+			$this->_old_reg_status[$REG_ID] = $old_reg_status;
103 103
 		}
104 104
 	}
105 105
 
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
 	 * @param int $REG_ID
110 110
 	 * @return string
111 111
 	 */
112
-	public function new_reg_status( $REG_ID ) {
113
-		return isset( $this->_new_reg_status[ $REG_ID ] ) ? $this->_new_reg_status[ $REG_ID ] : null;
112
+	public function new_reg_status($REG_ID) {
113
+		return isset($this->_new_reg_status[$REG_ID]) ? $this->_new_reg_status[$REG_ID] : null;
114 114
 	}
115 115
 
116 116
 
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
 	 * @param int $REG_ID
120 120
 	 * @param string $new_reg_status
121 121
 	 */
122
-	public function set_new_reg_status( $REG_ID, $new_reg_status ) {
123
-		$this->_new_reg_status[ $REG_ID ] = $new_reg_status;
122
+	public function set_new_reg_status($REG_ID, $new_reg_status) {
123
+		$this->_new_reg_status[$REG_ID] = $new_reg_status;
124 124
 	}
125 125
 
126 126
 
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 	 * @param int $REG_ID
132 132
 	 * @return bool
133 133
 	 */
134
-	public function reg_status_updated( $REG_ID ) {
135
-		return $this->new_reg_status( $REG_ID ) !== $this->old_reg_status( $REG_ID ) ? true : false;
134
+	public function reg_status_updated($REG_ID) {
135
+		return $this->new_reg_status($REG_ID) !== $this->old_reg_status($REG_ID) ? true : false;
136 136
 	}
137 137
 
138 138
 
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 	 * @param \EE_Registration $registration
142 142
 	 * @throws \EE_Error
143 143
 	 */
144
-	public function update_registration_status_and_trigger_notifications( \EE_Registration $registration ) {
145
-		$this->toggle_incomplete_registration_status_to_default( $registration, false );
146
-		$this->toggle_registration_status_for_default_approved_events( $registration, false );
147
-		$this->toggle_registration_status_if_no_monies_owing( $registration, false );
144
+	public function update_registration_status_and_trigger_notifications(\EE_Registration $registration) {
145
+		$this->toggle_incomplete_registration_status_to_default($registration, false);
146
+		$this->toggle_registration_status_for_default_approved_events($registration, false);
147
+		$this->toggle_registration_status_if_no_monies_owing($registration, false);
148 148
 		$registration->save();
149 149
 		// trigger notifications
150
-		$this->trigger_registration_update_notifications( $registration );
150
+		$this->trigger_registration_update_notifications($registration);
151 151
 	}
152 152
 
153 153
 
@@ -162,18 +162,18 @@  discard block
 block discarded – undo
162 162
 	 * @return boolean
163 163
 	 * @throws \EE_Error
164 164
 	 */
165
-	public function manually_update_registration_status( EE_Registration $registration, $new_reg_status = '', $save = true ) {
165
+	public function manually_update_registration_status(EE_Registration $registration, $new_reg_status = '', $save = true) {
166 166
 		// set initial REG_Status
167
-		$this->set_old_reg_status( $registration->ID(), $registration->status_ID() );
167
+		$this->set_old_reg_status($registration->ID(), $registration->status_ID());
168 168
 		// set incoming REG_Status
169
-		$this->set_new_reg_status( $registration->ID(), $new_reg_status );
169
+		$this->set_new_reg_status($registration->ID(), $new_reg_status);
170 170
 		// toggle reg status but only if it has changed and the user can do so
171 171
 		if (
172
-			$this->reg_status_updated( $registration->ID() ) &&
173
-			EE_Registry::instance()->CAP->current_user_can( 'ee_edit_registration', 'toggle_registration_status', $registration->ID() )
172
+			$this->reg_status_updated($registration->ID()) &&
173
+			EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'toggle_registration_status', $registration->ID())
174 174
 		) {
175 175
 			// change status to new value
176
-			if ( $registration->set_status( $this->new_reg_status( $registration->ID() ) ) && $save ) {
176
+			if ($registration->set_status($this->new_reg_status($registration->ID())) && $save) {
177 177
 				$registration->save();
178 178
 			}
179 179
 			return TRUE;
@@ -193,30 +193,30 @@  discard block
 block discarded – undo
193 193
 	 * @return void
194 194
 	 * @throws \EE_Error
195 195
 	 */
196
-	public function toggle_incomplete_registration_status_to_default( EE_Registration $registration, $save = TRUE ) {
196
+	public function toggle_incomplete_registration_status_to_default(EE_Registration $registration, $save = TRUE) {
197 197
 		$existing_reg_status = $registration->status_ID();
198 198
 		// set initial REG_Status
199
-		$this->set_old_reg_status( $registration->ID(), $existing_reg_status );
199
+		$this->set_old_reg_status($registration->ID(), $existing_reg_status);
200 200
 		// is the registration currently incomplete ?
201
-		if ( $registration->status_ID() === EEM_Registration::status_id_incomplete ) {
201
+		if ($registration->status_ID() === EEM_Registration::status_id_incomplete) {
202 202
 			// grab default reg status for the event, if set
203 203
 			$event_default_registration_status = $registration->event()->default_registration_status();
204 204
 			// if no default reg status is set for the event, then use the global value
205
-			$STS_ID = ! empty( $event_default_registration_status )
205
+			$STS_ID = ! empty($event_default_registration_status)
206 206
 				? $event_default_registration_status
207 207
 				: EE_Registry::instance()->CFG->registration->default_STS_ID;
208 208
 			// if the event default reg status is approved, then downgrade temporarily to payment pending to ensure that payments are triggered
209 209
 			$STS_ID = $STS_ID === EEM_Registration::status_id_approved ? EEM_Registration::status_id_pending_payment : $STS_ID;
210 210
 			// set incoming REG_Status
211
-			$this->set_new_reg_status( $registration->ID(), $STS_ID );
212
-			$registration->set_status( $STS_ID );
213
-			if ( $save ) {
211
+			$this->set_new_reg_status($registration->ID(), $STS_ID);
212
+			$registration->set_status($STS_ID);
213
+			if ($save) {
214 214
 				$registration->save();
215 215
 			}
216 216
 			// don't trigger notifications during IPNs because they will get triggered by EE_Payment_Processor
217
-			if ( ! EE_Processor_Base::$IPN ) {
217
+			if ( ! EE_Processor_Base::$IPN) {
218 218
                 // otherwise, send out notifications
219
-				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
219
+				add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
220 220
 			}
221 221
 			// DEBUG LOG
222 222
 			//$this->log(
@@ -241,10 +241,10 @@  discard block
 block discarded – undo
241 241
 	 * @return boolean
242 242
 	 * @throws \EE_Error
243 243
 	 */
244
-	public function toggle_registration_status_for_default_approved_events( EE_Registration $registration, $save = TRUE ) {
244
+	public function toggle_registration_status_for_default_approved_events(EE_Registration $registration, $save = TRUE) {
245 245
 		$reg_status = $registration->status_ID();
246 246
 		// set initial REG_Status
247
-		$this->set_old_reg_status( $registration->ID(), $reg_status );
247
+		$this->set_old_reg_status($registration->ID(), $reg_status);
248 248
 		// if not already, toggle reg status to approved IF the event default reg status is approved
249 249
 		// ( as long as the registration wasn't cancelled or declined at some point )
250 250
 		if (
@@ -254,16 +254,16 @@  discard block
 block discarded – undo
254 254
 			$registration->event()->default_registration_status() === EEM_Registration::status_id_approved
255 255
 		) {
256 256
 			// set incoming REG_Status
257
-			$this->set_new_reg_status( $registration->ID(), EEM_Registration::status_id_approved );
257
+			$this->set_new_reg_status($registration->ID(), EEM_Registration::status_id_approved);
258 258
 			// toggle status to approved
259
-			$registration->set_status( EEM_Registration::status_id_approved );
260
-			if ( $save ) {
259
+			$registration->set_status(EEM_Registration::status_id_approved);
260
+			if ($save) {
261 261
 				$registration->save();
262 262
 			}
263 263
 			// don't trigger notifications during IPNs because they will get triggered by EE_Payment_Processor
264
-			if ( ! EE_Processor_Base::$IPN ) {
264
+			if ( ! EE_Processor_Base::$IPN) {
265 265
                 // otherwise, send out notifications
266
-				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
266
+				add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
267 267
 			}
268 268
 			// DEBUG LOG
269 269
 			//$this->log(
@@ -291,19 +291,19 @@  discard block
 block discarded – undo
291 291
 	 * @return bool
292 292
 	 * @throws \EE_Error
293 293
 	 */
294
-	public function toggle_registration_status_if_no_monies_owing( EE_Registration $registration, $save = TRUE, $additional_details = array() ) {
294
+	public function toggle_registration_status_if_no_monies_owing(EE_Registration $registration, $save = TRUE, $additional_details = array()) {
295 295
 		// set initial REG_Status
296
-		$this->set_old_reg_status( $registration->ID(), $registration->status_ID() );
296
+		$this->set_old_reg_status($registration->ID(), $registration->status_ID());
297 297
 		//EEH_Debug_Tools::printr( $additional_details, '$additional_details', __FILE__, __LINE__ );
298 298
 		// was a payment just made ?
299 299
 		if (
300
-			isset( $additional_details[ 'payment_updates' ], $additional_details[ 'last_payment' ] ) &&
301
-			$additional_details[ 'payment_updates' ] &&
302
-			$additional_details[ 'last_payment' ] instanceof EE_Payment
300
+			isset($additional_details['payment_updates'], $additional_details['last_payment']) &&
301
+			$additional_details['payment_updates'] &&
302
+			$additional_details['last_payment'] instanceof EE_Payment
303 303
 		) {
304
-			$payment = $additional_details[ 'last_payment' ];
304
+			$payment = $additional_details['last_payment'];
305 305
 			$total_paid = 0;
306
-			foreach ( self::$_amount_paid as $reg => $amount_paid ) {
306
+			foreach (self::$_amount_paid as $reg => $amount_paid) {
307 307
 				$total_paid += $amount_paid;
308 308
 			}
309 309
 		} else {
@@ -327,30 +327,30 @@  discard block
 block discarded – undo
327 327
 					$registration->transaction()->is_completed() ||
328 328
 					$registration->transaction()->is_overpaid() ||
329 329
 					$registration->transaction()->is_free() ||
330
-					apply_filters( 'FHEE__EE_Registration_Processor__toggle_registration_status_if_no_monies_owing', false, $registration )
330
+					apply_filters('FHEE__EE_Registration_Processor__toggle_registration_status_if_no_monies_owing', false, $registration)
331 331
 				) || (
332 332
 					$payment instanceof EE_Payment &&
333 333
 					$payment->is_approved() &&
334 334
 					// this specific registration has not yet been paid for
335
-					! isset( self::$_amount_paid[ $registration->ID() ] ) &&
335
+					! isset(self::$_amount_paid[$registration->ID()]) &&
336 336
 					// payment amount, less what we have already attributed to other registrations, is greater than this reg's final price
337 337
 					$payment->amount() - $total_paid >= $registration->final_price()
338 338
 				)
339 339
 			)
340 340
 		) {
341 341
 			// mark as paid
342
-			self::$_amount_paid[ $registration->ID() ] = $registration->final_price();
342
+			self::$_amount_paid[$registration->ID()] = $registration->final_price();
343 343
 			// track new REG_Status
344
-			$this->set_new_reg_status( $registration->ID(), EEM_Registration::status_id_approved );
344
+			$this->set_new_reg_status($registration->ID(), EEM_Registration::status_id_approved);
345 345
 			// toggle status to approved
346
-			$registration->set_status( EEM_Registration::status_id_approved );
347
-			if ( $save ) {
346
+			$registration->set_status(EEM_Registration::status_id_approved);
347
+			if ($save) {
348 348
 				$registration->save();
349 349
 			}
350 350
 			// don't trigger notifications during IPNs because they will get triggered by EE_Payment_Processor
351
-			if ( ! EE_Processor_Base::$IPN ) {
351
+			if ( ! EE_Processor_Base::$IPN) {
352 352
                 // otherwise, send out notifications
353
-				add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10 );
353
+				add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_true', 10);
354 354
 			}
355 355
 			// DEBUG LOG
356 356
 			//$this->log(
@@ -376,10 +376,10 @@  discard block
 block discarded – undo
376 376
 	 * @param array 	$additional_details
377 377
 	 * @return void
378 378
 	 */
379
-	public function trigger_registration_update_notifications( $registration, $additional_details = array() ) {
379
+	public function trigger_registration_update_notifications($registration, $additional_details = array()) {
380 380
 		try {
381
-			if ( ! $registration instanceof EE_Registration ) {
382
-				throw new EE_Error( __( 'An invalid registration was received.', 'event_espresso' ) );
381
+			if ( ! $registration instanceof EE_Registration) {
382
+				throw new EE_Error(__('An invalid registration was received.', 'event_espresso'));
383 383
 			}
384 384
 			// EE_Registry::instance()->load_helper( 'Debug_Tools' );
385 385
 			// EEH_Debug_Tools::log(
@@ -398,8 +398,8 @@  discard block
 block discarded – undo
398 398
 				$registration,
399 399
 				$additional_details
400 400
 			);
401
-		} catch( Exception $e ) {
402
-			EE_Error::add_error( $e->getMessage(), $e->getFile(), 'unknown_function_from_exception', $e->getLine() );
401
+		} catch (Exception $e) {
402
+			EE_Error::add_error($e->getMessage(), $e->getFile(), 'unknown_function_from_exception', $e->getLine());
403 403
 		}
404 404
 	}
405 405
 
@@ -413,22 +413,22 @@  discard block
 block discarded – undo
413 413
 	 * @return bool
414 414
 	 * @throws \EE_Error
415 415
 	 */
416
-	public function update_registration_after_checkout_or_payment(  EE_Registration $registration, $additional_details = array() ) {
416
+	public function update_registration_after_checkout_or_payment(EE_Registration $registration, $additional_details = array()) {
417 417
 		// set initial REG_Status
418
-		$this->set_old_reg_status( $registration->ID(), $registration->status_ID() );
418
+		$this->set_old_reg_status($registration->ID(), $registration->status_ID());
419 419
 
420 420
 		// if the registration status gets updated, then save the registration
421 421
 		if (
422
-			$this->toggle_registration_status_for_default_approved_events( $registration, false )
423
-			|| $this->toggle_registration_status_if_no_monies_owing( $registration, false, $additional_details )
422
+			$this->toggle_registration_status_for_default_approved_events($registration, false)
423
+			|| $this->toggle_registration_status_if_no_monies_owing($registration, false, $additional_details)
424 424
 		) {
425 425
 			$registration->save();
426 426
 		}
427 427
 
428 428
 		// set new  REG_Status
429
-		$this->set_new_reg_status( $registration->ID(), $registration->status_ID() );
430
-		return $this->reg_status_updated( $registration->ID() )
431
-		       && $this->new_reg_status( $registration->ID() ) === EEM_Registration::status_id_approved
429
+		$this->set_new_reg_status($registration->ID(), $registration->status_ID());
430
+		return $this->reg_status_updated($registration->ID())
431
+		       && $this->new_reg_status($registration->ID()) === EEM_Registration::status_id_approved
432 432
 			? true
433 433
 			: false;
434 434
 	}
@@ -444,20 +444,20 @@  discard block
 block discarded – undo
444 444
 	 * @return void
445 445
 	 * @throws \EE_Error
446 446
 	 */
447
-	public function update_registration_final_prices( $transaction, $save_regs = true ) {
448
-		$reg_final_price_per_ticket_line_item = EEH_Line_Item::calculate_reg_final_prices_per_line_item( $transaction->total_line_item() );
449
-		foreach( $transaction->registrations() as $registration ) {
447
+	public function update_registration_final_prices($transaction, $save_regs = true) {
448
+		$reg_final_price_per_ticket_line_item = EEH_Line_Item::calculate_reg_final_prices_per_line_item($transaction->total_line_item());
449
+		foreach ($transaction->registrations() as $registration) {
450 450
 			/** @var EE_Line_Item $line_item */
451
-			$line_item = EEM_Line_Item::instance()->get_line_item_for_registration( $registration );
452
-			if( isset( $reg_final_price_per_ticket_line_item[ $line_item->ID() ] ) ) {
453
-				$registration->set_final_price( $reg_final_price_per_ticket_line_item[ $line_item->ID() ] );
454
-				if( $save_regs ) {
451
+			$line_item = EEM_Line_Item::instance()->get_line_item_for_registration($registration);
452
+			if (isset($reg_final_price_per_ticket_line_item[$line_item->ID()])) {
453
+				$registration->set_final_price($reg_final_price_per_ticket_line_item[$line_item->ID()]);
454
+				if ($save_regs) {
455 455
 					$registration->save();
456 456
 				}
457 457
 			}
458 458
 		}
459 459
 		//and make sure there's no rounding problem
460
-		$this->fix_reg_final_price_rounding_issue( $transaction );
460
+		$this->fix_reg_final_price_rounding_issue($transaction);
461 461
 	}
462 462
 
463 463
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 	 * @return boolean success verifying that there is NO difference after this method is done
478 478
 	 * @throws \EE_Error
479 479
 	 */
480
-	public function fix_reg_final_price_rounding_issue( $transaction ) {
480
+	public function fix_reg_final_price_rounding_issue($transaction) {
481 481
 		$reg_final_price_sum = EEM_Registration::instance()->sum(
482 482
 			array(
483 483
 				array(
@@ -486,9 +486,9 @@  discard block
 block discarded – undo
486 486
 			),
487 487
 			'REG_final_price'
488 488
 		);
489
-		$diff =  $transaction->total() - (float) $reg_final_price_sum;
489
+		$diff = $transaction->total() - (float) $reg_final_price_sum;
490 490
 		//ok then, just grab one of the registrations
491
-		if( $diff !== 0 ) {
491
+		if ($diff !== 0) {
492 492
 			$a_reg = EEM_Registration::instance()->get_one(
493 493
 					array(
494 494
 						array(
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 					));
498 498
 			$success = $a_reg instanceof EE_Registration
499 499
 				? $a_reg->save(
500
-					array( 'REG_final_price' => $a_reg->final_price() + $diff )
500
+					array('REG_final_price' => $a_reg->final_price() + $diff)
501 501
 				)
502 502
 				: false;
503 503
 			return $success ? true : false;
@@ -523,16 +523,16 @@  discard block
 block discarded – undo
523 523
 		$update_reg = true
524 524
 	) {
525 525
 		// these reg statuses should not be considered in any calculations involving monies owing
526
-		$closed_reg_statuses = ! empty( $closed_reg_statuses )
526
+		$closed_reg_statuses = ! empty($closed_reg_statuses)
527 527
             ? $closed_reg_statuses
528 528
 			: EEM_Registration::closed_reg_statuses();
529
-		if ( ! in_array( $registration->status_ID(), $closed_reg_statuses, true ) ) {
529
+		if ( ! in_array($registration->status_ID(), $closed_reg_statuses, true)) {
530 530
 			return false;
531 531
 		}
532 532
         // release a reserved ticket by decrementing ticket and datetime reserved values
533 533
         $registration->release_reserved_ticket(true);
534 534
         $registration->set_final_price(0);
535
-		if ( $update_reg ) {
535
+		if ($update_reg) {
536 536
 			$registration->save();
537 537
 		}
538 538
 		return true;
@@ -555,23 +555,23 @@  discard block
 block discarded – undo
555 555
 		$update_reg = true
556 556
 	) {
557 557
 		// these reg statuses should not be considered in any calculations involving monies owing
558
-		$closed_reg_statuses = ! empty( $closed_reg_statuses ) ? $closed_reg_statuses
558
+		$closed_reg_statuses = ! empty($closed_reg_statuses) ? $closed_reg_statuses
559 559
 			: EEM_Registration::closed_reg_statuses();
560
-		if ( in_array( $registration->status_ID(), $closed_reg_statuses ) ) {
560
+		if (in_array($registration->status_ID(), $closed_reg_statuses)) {
561 561
 			return false;
562 562
 		}
563 563
 		$ticket = $registration->ticket();
564
-		if ( ! $ticket instanceof EE_Ticket ) {
564
+		if ( ! $ticket instanceof EE_Ticket) {
565 565
 			throw new EE_Error(
566 566
 				sprintf(
567
-					__( 'The Ticket for Registration %1$d was not found or is invalid.',
568
-						'event_espresso' ),
567
+					__('The Ticket for Registration %1$d was not found or is invalid.',
568
+						'event_espresso'),
569 569
 					$registration->ticket_ID()
570 570
 				)
571 571
 			);
572 572
 		}
573
-		$registration->set_final_price( $ticket->price() );
574
-		if ( $update_reg ) {
573
+		$registration->set_final_price($ticket->price());
574
+		if ($update_reg) {
575 575
 			$registration->save();
576 576
 		}
577 577
 		return true;
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 		$total_ticket_count = 1
610 610
 	) {
611 611
 		EE_Error::doing_it_wrong(
612
-			__CLASS__ . '::' . __FUNCTION__,
612
+			__CLASS__.'::'.__FUNCTION__,
613 613
 			sprintf(__('This method is deprecated. Please use "%s" instead', 'event_espresso'),
614 614
 				'\EventEspresso\core\domain\services\registration\CreateRegistrationService::create()'),
615 615
 			'4.9.1',
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 	public function generate_reg_url_link($att_nmbr, $item)
653 653
 	{
654 654
 		EE_Error::doing_it_wrong(
655
-			__CLASS__ . '::' . __FUNCTION__,
655
+			__CLASS__.'::'.__FUNCTION__,
656 656
 			sprintf(__('This method is deprecated. Please use "%s" instead', 'event_espresso'),
657 657
 				'EventEspresso\core\domain\entities\RegUrlLink'),
658 658
 			'4.9.1',
@@ -672,11 +672,11 @@  discard block
 block discarded – undo
672 672
 	 * @return string
673 673
 	 * @throws \EE_Error
674 674
 	 */
675
-	public function generate_reg_code( EE_Registration $registration ) {
675
+	public function generate_reg_code(EE_Registration $registration) {
676 676
 		EE_Error::doing_it_wrong(
677
-			__CLASS__ . '::' . __FUNCTION__,
677
+			__CLASS__.'::'.__FUNCTION__,
678 678
 			sprintf(
679
-				__( 'This method is deprecated. Please use "%s" instead', 'event_espresso' ),
679
+				__('This method is deprecated. Please use "%s" instead', 'event_espresso'),
680 680
 				'EventEspresso\core\domain\entities\RegCode'
681 681
 			),
682 682
 			'4.9.1',
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 		return apply_filters(
686 686
 			'FHEE__EE_Registration_Processor___generate_reg_code__new_reg_code',
687 687
 			new RegCode(
688
-				RegUrlLink::fromRegistration( $registration ),
688
+				RegUrlLink::fromRegistration($registration),
689 689
 				$registration->transaction(),
690 690
 				$registration->ticket()
691 691
 			),
Please login to merge, or discard this patch.
core/domain/entities/GenericAddress.php 2 patches
Doc Comments   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,6 +42,8 @@  discard block
 block discarded – undo
42 42
 	 * @param \EE_State | string   $state
43 43
 	 * @param string              $zip
44 44
 	 * @param \EE_Country | string $country
45
+	 * @param integer $state
46
+	 * @param string $country
45 47
 	 * @return GenericAddress
46 48
 	 */
47 49
 	public function __construct( $address, $address2, $city, $state, $zip, $country ) {
@@ -135,7 +137,7 @@  discard block
 block discarded – undo
135 137
 
136 138
 
137 139
 	/**
138
-	 * @return \EE_State
140
+	 * @return string
139 141
 	 */
140 142
 	public function state_obj() {
141 143
 		return $this->_state_obj;
@@ -188,7 +190,7 @@  discard block
 block discarded – undo
188 190
 
189 191
 
190 192
 	/**
191
-	 * @return \EE_Country
193
+	 * @return string
192 194
 	 */
193 195
 	public function country_obj() {
194 196
 		return $this->_country_obj;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace EventEspresso\core\domain\entities;
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
 
@@ -44,18 +44,18 @@  discard block
 block discarded – undo
44 44
 	 * @param \EE_Country | string $country
45 45
 	 * @return GenericAddress
46 46
 	 */
47
-	public function __construct( $address, $address2, $city, $state, $zip, $country ) {
47
+	public function __construct($address, $address2, $city, $state, $zip, $country) {
48 48
 		$this->_address = $address;
49 49
 		$this->_address2 = $address2;
50 50
 		$this->_city = $city;
51
-		if ( $state instanceof \EE_State ) {
51
+		if ($state instanceof \EE_State) {
52 52
 			$this->_state_obj = $state;
53 53
 		} else {
54 54
 			$this->_state_ID = $state;
55 55
 			$this->_state_obj = $this->_get_state_obj();
56 56
 		}
57 57
 		$this->_zip = $zip;
58
-		if ( $country instanceof \EE_Country ) {
58
+		if ($country instanceof \EE_Country) {
59 59
 			$this->_country_obj = $country;
60 60
 		} else {
61 61
 			$this->_country_ID = $country;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	private function _get_state_obj() {
99 99
 		return $this->_state_obj instanceof \EE_State
100 100
 			? $this->_state_obj
101
-			: \EE_Registry::instance()->load_model( 'State' )->get_one_by_ID( $this->_state_ID );
101
+			: \EE_Registry::instance()->load_model('State')->get_one_by_ID($this->_state_ID);
102 102
 	}
103 103
 
104 104
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	 * @return string
148 148
 	 */
149 149
 	public function state() {
150
-		if ( apply_filters( 'FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj() ) ) {
150
+		if (apply_filters('FHEE__EEI_Address__state__use_abbreviation', true, $this->state_obj())) {
151 151
 			return $this->state_obj()->abbrev();
152 152
 		} else {
153 153
 			return $this->state_name();
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	private function _get_country_obj() {
163 163
 		return $this->_country_obj instanceof \EE_Country
164 164
 			? $this->_country_obj
165
-			: \EE_Registry::instance()->load_model( 'Country' )->get_one_by_ID( $this->_country_ID );
165
+			: \EE_Registry::instance()->load_model('Country')->get_one_by_ID($this->_country_ID);
166 166
 	}
167 167
 
168 168
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	 * @return string
201 201
 	 */
202 202
 	public function country() {
203
-		if ( apply_filters( 'FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj() ) ) {
203
+		if (apply_filters('FHEE__EEI_Address__country__use_abbreviation', true, $this->country_obj())) {
204 204
 			return $this->country_ID();
205 205
 		} else {
206 206
 			return $this->country_name();
Please login to merge, or discard this patch.