Completed
Branch back-compat-edtr-taxes (752e0e)
by
unknown
12:08 queued 09:43
created
core/libraries/shortcodes/EE_Attendee_List_Shortcodes.lib.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         $att_result    = '';
160 160
         $registrations =
161 161
             isset($this->_extra_data['data']->tickets)
162
-                ? $this->_extra_data['data']->tickets[ $ticket->ID() ]['reg_objs']
162
+                ? $this->_extra_data['data']->tickets[$ticket->ID()]['reg_objs']
163 163
                 : [];
164 164
 
165 165
         // each attendee in this case should be an attendee object.
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
     private function _get_registrations_from_event(EE_Event $event)
186 186
     {
187 187
         return isset($this->_extra_data['data']->events)
188
-            ? $this->_extra_data['data']->events[ $event->ID() ]['reg_objs']
188
+            ? $this->_extra_data['data']->events[$event->ID()]['reg_objs']
189 189
             : [];
190 190
     }
191 191
 }
Please login to merge, or discard this patch.
Indentation   +169 added lines, -169 removed lines patch added patch discarded remove patch
@@ -19,173 +19,173 @@
 block discarded – undo
19 19
 class EE_Attendee_List_Shortcodes extends EE_Shortcodes
20 20
 {
21 21
 
22
-    public function __construct()
23
-    {
24
-        parent::__construct();
25
-    }
26
-
27
-
28
-    protected function _init_props()
29
-    {
30
-        $this->label       = esc_html__('Attendee List Shortcodes', 'event_espresso');
31
-        $this->description = esc_html__('All shortcodes specific to attendee lists', 'event_espresso');
32
-        $this->_shortcodes = [
33
-            '[ATTENDEE_LIST]' => esc_html__('Will output a list of attendees', 'event_espresso'),
34
-        ];
35
-    }
36
-
37
-
38
-    /**
39
-     * @param string $shortcode
40
-     * @return string
41
-     * @throws EE_Error
42
-     * @throws ReflectionException
43
-     */
44
-    protected function _parser($shortcode)
45
-    {
46
-        switch ($shortcode) {
47
-            case '[ATTENDEE_LIST]':
48
-                return $this->_get_attendee_list();
49
-        }
50
-        return '';
51
-    }
52
-
53
-
54
-    /**
55
-     * figure out what the incoming data is and then return the appropriate parsed value.
56
-     *
57
-     * @return string
58
-     * @throws EE_Error
59
-     * @throws ReflectionException
60
-     */
61
-    private function _get_attendee_list()
62
-    {
63
-        $this->_validate_list_requirements();
64
-
65
-        if ($this->_data['data'] instanceof EE_Messages_Addressee) {
66
-            return $this->_get_attendee_list_for_main();
67
-        }
68
-        if ($this->_data['data'] instanceof EE_Event) {
69
-            return $this->_get_attendee_list_for_event();
70
-        }
71
-        if ($this->_data['data'] instanceof EE_Ticket) {
72
-            return $this->_get_registration_list_for_ticket();
73
-        }
74
-        // prevent recursive loop
75
-        return '';
76
-    }
77
-
78
-
79
-    /**
80
-     * This returns the parsed attendee list for main template;
81
-     */
82
-    private function _get_attendee_list_for_main()
83
-    {
84
-        $valid_shortcodes = ['attendee', 'event_list', 'ticket_list', 'question_list', 'recipient_details'];
85
-        $template         = $this->_data['template'];
86
-        $data             = $this->_data['data'];
87
-        $attendees        = '';
88
-
89
-
90
-        // now we need to loop through the attendee list and send data to the EE_Parser helper.
91
-        foreach ($data->reg_objs as $registration) {
92
-            $attendees .= $this->_shortcode_helper->parse_attendee_list_template(
93
-                $template,
94
-                $registration,
95
-                $valid_shortcodes,
96
-                $this->_extra_data
97
-            );
98
-        }
99
-
100
-        return $attendees;
101
-    }
102
-
103
-
104
-    /**
105
-     * return parsed list of attendees for an event
106
-     *
107
-     * @return string
108
-     * @throws EE_Error
109
-     * @throws ReflectionException
110
-     */
111
-    private function _get_attendee_list_for_event()
112
-    {
113
-        $valid_shortcodes = ['attendee', 'ticket_list', 'question_list', 'recipient_details'];
114
-        $template         = is_array($this->_data['template']) && isset($this->_data['template']['attendee_list'])
115
-            ? $this->_data['template']['attendee_list']
116
-            : $this->_extra_data['template']['attendee_list'];
117
-        $event            = $this->_data['data'];
118
-
119
-        // let's remove any existing [EVENT_LIST] shortcode from the attendee list template so that we don't get recursion.
120
-        $template = str_replace('[EVENT_LIST]', '', $template);
121
-
122
-        // here we're setting up the attendees for the attendee_list template for THIS event.
123
-        $att_result    = '';
124
-        $registrations = $this->_get_registrations_from_event($event);
125
-
126
-        // each attendee in this case should be an attendee object.
127
-        foreach ($registrations as $registration) {
128
-            $att_result .= $this->_shortcode_helper->parse_attendee_list_template(
129
-                $template,
130
-                $registration,
131
-                $valid_shortcodes,
132
-                $this->_extra_data
133
-            );
134
-        }
135
-
136
-        return $att_result;
137
-    }
138
-
139
-
140
-    /**
141
-     * return parsed list of attendees for a ticket
142
-     *
143
-     * @return string
144
-     */
145
-    private function _get_registration_list_for_ticket()
146
-    {
147
-        $valid_shortcodes = ['attendee', 'event_list', 'question_list', 'recipient_details'];
148
-        $template         = is_array($this->_data['template']) && isset($this->_data['template']['attendee_list'])
149
-            ? $this->_data['template']['attendee_list']
150
-            : $this->_extra_data['template']['attendee_list'];
151
-        $ticket           = $this->_data['data'];
152
-
153
-        // let's remove any existing [TICKET_LIST] (or related) shortcode from the attendee list template so that we don't get recursion.
154
-        $template = str_replace('[TICKET_LIST]', '', $template);
155
-        $template = str_replace('[RECIPIENT_TICKET_LIST]', '', $template);
156
-        $template = str_replace('[PRIMARY_REGISTRANT_TICKET_LIST]', '', $template);
157
-
158
-        // here we're setting up the attendees for the attendee_list template for THIS ticket.
159
-        $att_result    = '';
160
-        $registrations =
161
-            isset($this->_extra_data['data']->tickets)
162
-                ? $this->_extra_data['data']->tickets[ $ticket->ID() ]['reg_objs']
163
-                : [];
164
-
165
-        // each attendee in this case should be an attendee object.
166
-        foreach ($registrations as $registration) {
167
-            $att_result .= $this->_shortcode_helper->parse_attendee_list_template(
168
-                $template,
169
-                $registration,
170
-                $valid_shortcodes,
171
-                $this->_extra_data
172
-            );
173
-        }
174
-
175
-        return $att_result;
176
-    }
177
-
178
-
179
-    /**
180
-     * @param EE_Event $event
181
-     * @return array|mixed
182
-     * @throws EE_Error
183
-     * @throws ReflectionException
184
-     */
185
-    private function _get_registrations_from_event(EE_Event $event)
186
-    {
187
-        return isset($this->_extra_data['data']->events)
188
-            ? $this->_extra_data['data']->events[ $event->ID() ]['reg_objs']
189
-            : [];
190
-    }
22
+	public function __construct()
23
+	{
24
+		parent::__construct();
25
+	}
26
+
27
+
28
+	protected function _init_props()
29
+	{
30
+		$this->label       = esc_html__('Attendee List Shortcodes', 'event_espresso');
31
+		$this->description = esc_html__('All shortcodes specific to attendee lists', 'event_espresso');
32
+		$this->_shortcodes = [
33
+			'[ATTENDEE_LIST]' => esc_html__('Will output a list of attendees', 'event_espresso'),
34
+		];
35
+	}
36
+
37
+
38
+	/**
39
+	 * @param string $shortcode
40
+	 * @return string
41
+	 * @throws EE_Error
42
+	 * @throws ReflectionException
43
+	 */
44
+	protected function _parser($shortcode)
45
+	{
46
+		switch ($shortcode) {
47
+			case '[ATTENDEE_LIST]':
48
+				return $this->_get_attendee_list();
49
+		}
50
+		return '';
51
+	}
52
+
53
+
54
+	/**
55
+	 * figure out what the incoming data is and then return the appropriate parsed value.
56
+	 *
57
+	 * @return string
58
+	 * @throws EE_Error
59
+	 * @throws ReflectionException
60
+	 */
61
+	private function _get_attendee_list()
62
+	{
63
+		$this->_validate_list_requirements();
64
+
65
+		if ($this->_data['data'] instanceof EE_Messages_Addressee) {
66
+			return $this->_get_attendee_list_for_main();
67
+		}
68
+		if ($this->_data['data'] instanceof EE_Event) {
69
+			return $this->_get_attendee_list_for_event();
70
+		}
71
+		if ($this->_data['data'] instanceof EE_Ticket) {
72
+			return $this->_get_registration_list_for_ticket();
73
+		}
74
+		// prevent recursive loop
75
+		return '';
76
+	}
77
+
78
+
79
+	/**
80
+	 * This returns the parsed attendee list for main template;
81
+	 */
82
+	private function _get_attendee_list_for_main()
83
+	{
84
+		$valid_shortcodes = ['attendee', 'event_list', 'ticket_list', 'question_list', 'recipient_details'];
85
+		$template         = $this->_data['template'];
86
+		$data             = $this->_data['data'];
87
+		$attendees        = '';
88
+
89
+
90
+		// now we need to loop through the attendee list and send data to the EE_Parser helper.
91
+		foreach ($data->reg_objs as $registration) {
92
+			$attendees .= $this->_shortcode_helper->parse_attendee_list_template(
93
+				$template,
94
+				$registration,
95
+				$valid_shortcodes,
96
+				$this->_extra_data
97
+			);
98
+		}
99
+
100
+		return $attendees;
101
+	}
102
+
103
+
104
+	/**
105
+	 * return parsed list of attendees for an event
106
+	 *
107
+	 * @return string
108
+	 * @throws EE_Error
109
+	 * @throws ReflectionException
110
+	 */
111
+	private function _get_attendee_list_for_event()
112
+	{
113
+		$valid_shortcodes = ['attendee', 'ticket_list', 'question_list', 'recipient_details'];
114
+		$template         = is_array($this->_data['template']) && isset($this->_data['template']['attendee_list'])
115
+			? $this->_data['template']['attendee_list']
116
+			: $this->_extra_data['template']['attendee_list'];
117
+		$event            = $this->_data['data'];
118
+
119
+		// let's remove any existing [EVENT_LIST] shortcode from the attendee list template so that we don't get recursion.
120
+		$template = str_replace('[EVENT_LIST]', '', $template);
121
+
122
+		// here we're setting up the attendees for the attendee_list template for THIS event.
123
+		$att_result    = '';
124
+		$registrations = $this->_get_registrations_from_event($event);
125
+
126
+		// each attendee in this case should be an attendee object.
127
+		foreach ($registrations as $registration) {
128
+			$att_result .= $this->_shortcode_helper->parse_attendee_list_template(
129
+				$template,
130
+				$registration,
131
+				$valid_shortcodes,
132
+				$this->_extra_data
133
+			);
134
+		}
135
+
136
+		return $att_result;
137
+	}
138
+
139
+
140
+	/**
141
+	 * return parsed list of attendees for a ticket
142
+	 *
143
+	 * @return string
144
+	 */
145
+	private function _get_registration_list_for_ticket()
146
+	{
147
+		$valid_shortcodes = ['attendee', 'event_list', 'question_list', 'recipient_details'];
148
+		$template         = is_array($this->_data['template']) && isset($this->_data['template']['attendee_list'])
149
+			? $this->_data['template']['attendee_list']
150
+			: $this->_extra_data['template']['attendee_list'];
151
+		$ticket           = $this->_data['data'];
152
+
153
+		// let's remove any existing [TICKET_LIST] (or related) shortcode from the attendee list template so that we don't get recursion.
154
+		$template = str_replace('[TICKET_LIST]', '', $template);
155
+		$template = str_replace('[RECIPIENT_TICKET_LIST]', '', $template);
156
+		$template = str_replace('[PRIMARY_REGISTRANT_TICKET_LIST]', '', $template);
157
+
158
+		// here we're setting up the attendees for the attendee_list template for THIS ticket.
159
+		$att_result    = '';
160
+		$registrations =
161
+			isset($this->_extra_data['data']->tickets)
162
+				? $this->_extra_data['data']->tickets[ $ticket->ID() ]['reg_objs']
163
+				: [];
164
+
165
+		// each attendee in this case should be an attendee object.
166
+		foreach ($registrations as $registration) {
167
+			$att_result .= $this->_shortcode_helper->parse_attendee_list_template(
168
+				$template,
169
+				$registration,
170
+				$valid_shortcodes,
171
+				$this->_extra_data
172
+			);
173
+		}
174
+
175
+		return $att_result;
176
+	}
177
+
178
+
179
+	/**
180
+	 * @param EE_Event $event
181
+	 * @return array|mixed
182
+	 * @throws EE_Error
183
+	 * @throws ReflectionException
184
+	 */
185
+	private function _get_registrations_from_event(EE_Event $event)
186
+	{
187
+		return isset($this->_extra_data['data']->events)
188
+			? $this->_extra_data['data']->events[ $event->ID() ]['reg_objs']
189
+			: [];
190
+	}
191 191
 }
Please login to merge, or discard this patch.
core/admin/EE_Admin_Page_Menu_Group.core.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -14,31 +14,31 @@
 block discarded – undo
14 14
 class EE_Admin_Page_Menu_Group extends EE_Admin_Page_Menu_Map
15 15
 {
16 16
 
17
-    /**
18
-     * @throws EE_Error
19
-     */
20
-    public function __construct($menu_args = [])
21
-    {
22
-        $required = ['menu_label', 'menu_slug', 'menu_order', 'parent_slug'];
23
-        parent::__construct($menu_args, $required);
24
-    }
17
+	/**
18
+	 * @throws EE_Error
19
+	 */
20
+	public function __construct($menu_args = [])
21
+	{
22
+		$required = ['menu_label', 'menu_slug', 'menu_order', 'parent_slug'];
23
+		parent::__construct($menu_args, $required);
24
+	}
25 25
 
26 26
 
27
-    protected function _add_menu_page()
28
-    {
29
-        return add_submenu_page(
30
-            $this->parent_slug,
31
-            $this->menu_label,
32
-            $this->_group_link(),
33
-            $this->capability,
34
-            $this->menu_slug,
35
-            '__return_false'
36
-        );
37
-    }
27
+	protected function _add_menu_page()
28
+	{
29
+		return add_submenu_page(
30
+			$this->parent_slug,
31
+			$this->menu_label,
32
+			$this->_group_link(),
33
+			$this->capability,
34
+			$this->menu_slug,
35
+			'__return_false'
36
+		);
37
+	}
38 38
 
39 39
 
40
-    private function _group_link()
41
-    {
42
-        return '<span class="ee_menu_group"  onclick="return false;">' . $this->menu_label . '</span>';
43
-    }
40
+	private function _group_link()
41
+	{
42
+		return '<span class="ee_menu_group"  onclick="return false;">' . $this->menu_label . '</span>';
43
+	}
44 44
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,6 +39,6 @@
 block discarded – undo
39 39
 
40 40
     private function _group_link()
41 41
     {
42
-        return '<span class="ee_menu_group"  onclick="return false;">' . $this->menu_label . '</span>';
42
+        return '<span class="ee_menu_group"  onclick="return false;">'.$this->menu_label.'</span>';
43 43
     }
44 44
 }
Please login to merge, or discard this patch.
core/admin/EE_Admin_Page_Sub_Menu.core.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -10,21 +10,21 @@
 block discarded – undo
10 10
 class EE_Admin_Page_Sub_Menu extends EE_Admin_Page_Main_Menu
11 11
 {
12 12
 
13
-    public function __construct($menu_args)
14
-    {
15
-        parent::__construct($menu_args);
16
-    }
13
+	public function __construct($menu_args)
14
+	{
15
+		parent::__construct($menu_args);
16
+	}
17 17
 
18 18
 
19
-    protected function _add_menu_page()
20
-    {
21
-        return add_submenu_page(
22
-            $this->parent_slug,
23
-            $this->title,
24
-            $this->menu_label,
25
-            $this->capability,
26
-            $this->menu_slug,
27
-            $this->menu_callback
28
-        );
29
-    }
19
+	protected function _add_menu_page()
20
+	{
21
+		return add_submenu_page(
22
+			$this->parent_slug,
23
+			$this->title,
24
+			$this->menu_label,
25
+			$this->capability,
26
+			$this->menu_slug,
27
+			$this->menu_callback
28
+		);
29
+	}
30 30
 }
Please login to merge, or discard this patch.
core/admin/EE_Admin_Page_Main_Menu.core.php 2 patches
Indentation   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -10,76 +10,76 @@
 block discarded – undo
10 10
 class EE_Admin_Page_Main_Menu extends EE_Admin_Page_Menu_Map
11 11
 {
12 12
 
13
-    /**
14
-     * If included int incoming params, then this class will also register a Sub Menue Admin page with a different
15
-     * subtitle than the main menu item.
16
-     *
17
-     * @since 4.4.0
18
-     *
19
-     * @var string
20
-     */
21
-    public $subtitle;
13
+	/**
14
+	 * If included int incoming params, then this class will also register a Sub Menue Admin page with a different
15
+	 * subtitle than the main menu item.
16
+	 *
17
+	 * @since 4.4.0
18
+	 *
19
+	 * @var string
20
+	 */
21
+	public $subtitle;
22 22
 
23
-    /**
24
-     * The page to a icon used for this menu.
25
-     *
26
-     * @since  4.4.0
27
-     * @see    http://codex.wordpress.org/Function_Reference/add_menu_page#Parameters
28
-     *        for what can be set for this property.
29
-     * @var string
30
-     */
31
-    public $icon_url;
23
+	/**
24
+	 * The page to a icon used for this menu.
25
+	 *
26
+	 * @since  4.4.0
27
+	 * @see    http://codex.wordpress.org/Function_Reference/add_menu_page#Parameters
28
+	 *        for what can be set for this property.
29
+	 * @var string
30
+	 */
31
+	public $icon_url;
32 32
 
33 33
 
34
-    /**
35
-     * What position in the main menu order for the WP admin menu this menu item
36
-     * should show.
37
-     *
38
-     * @since  4.4.0
39
-     * @see    http://codex.wordpress.org/Function_Reference/add_menu_page#Parameters
40
-     *        for what can be set for this property.
41
-     * @var integer
42
-     */
43
-    public $position;
34
+	/**
35
+	 * What position in the main menu order for the WP admin menu this menu item
36
+	 * should show.
37
+	 *
38
+	 * @since  4.4.0
39
+	 * @see    http://codex.wordpress.org/Function_Reference/add_menu_page#Parameters
40
+	 *        for what can be set for this property.
41
+	 * @var integer
42
+	 */
43
+	public $position;
44 44
 
45 45
 
46
-    /**
47
-     * @throws EE_Error
48
-     */
49
-    public function __construct($menu_args)
50
-    {
51
-        $required = ['menu_label', 'parent_slug', 'menu_slug', 'menu_group', 'menu_order', 'admin_init_page'];
46
+	/**
47
+	 * @throws EE_Error
48
+	 */
49
+	public function __construct($menu_args)
50
+	{
51
+		$required = ['menu_label', 'parent_slug', 'menu_slug', 'menu_group', 'menu_order', 'admin_init_page'];
52 52
 
53
-        parent::__construct($menu_args, $required);
53
+		parent::__construct($menu_args, $required);
54 54
 
55
-        $this->position = ! empty($this->position) ? (int) $this->position : $this->position;
56
-    }
55
+		$this->position = ! empty($this->position) ? (int) $this->position : $this->position;
56
+	}
57 57
 
58 58
 
59
-    /**
60
-     * Uses the proper WP utility for registering a menu page for the main WP pages.
61
-     */
62
-    protected function _add_menu_page()
63
-    {
64
-        $main = add_menu_page(
65
-            $this->title,
66
-            $this->menu_label,
67
-            $this->capability,
68
-            $this->parent_slug,
69
-            $this->menu_callback,
70
-            $this->icon_url,
71
-            $this->position
72
-        );
73
-        if (! empty($this->subtitle)) {
74
-            add_submenu_page(
75
-                $this->parent_slug,
76
-                $this->subtitle,
77
-                $this->subtitle,
78
-                $this->capability,
79
-                $this->menu_slug,
80
-                $this->menu_callback
81
-            );
82
-        }
83
-        return $main;
84
-    }
59
+	/**
60
+	 * Uses the proper WP utility for registering a menu page for the main WP pages.
61
+	 */
62
+	protected function _add_menu_page()
63
+	{
64
+		$main = add_menu_page(
65
+			$this->title,
66
+			$this->menu_label,
67
+			$this->capability,
68
+			$this->parent_slug,
69
+			$this->menu_callback,
70
+			$this->icon_url,
71
+			$this->position
72
+		);
73
+		if (! empty($this->subtitle)) {
74
+			add_submenu_page(
75
+				$this->parent_slug,
76
+				$this->subtitle,
77
+				$this->subtitle,
78
+				$this->capability,
79
+				$this->menu_slug,
80
+				$this->menu_callback
81
+			);
82
+		}
83
+		return $main;
84
+	}
85 85
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
             $this->icon_url,
71 71
             $this->position
72 72
         );
73
-        if (! empty($this->subtitle)) {
73
+        if ( ! empty($this->subtitle)) {
74 74
             add_submenu_page(
75 75
                 $this->parent_slug,
76 76
                 $this->subtitle,
Please login to merge, or discard this patch.
core/domain/services/admin/privacy/policy/privacy_policy.template.php 2 patches
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 ?>
8 8
 <h2><?php esc_html_e('Event Registration Data', 'event_espresso'); ?></h2>
9 9
 <p><?php
10
-    esc_html_e(
11
-        'We collect information about you during event registration. This information may include but is not limited to:',
12
-        'event_espresso'
13
-    ); ?></p>
10
+	esc_html_e(
11
+		'We collect information about you during event registration. This information may include but is not limited to:',
12
+		'event_espresso'
13
+	); ?></p>
14 14
 <ul>
15 15
     <li><?php esc_html_e('Your names', 'event_espresso'); ?></li>
16 16
     <li><?php esc_html_e('Billing address', 'event_espresso'); ?></li>
@@ -18,16 +18,16 @@  discard block
 block discarded – undo
18 18
     <li><?php esc_html_e('Email address', 'event_espresso'); ?></li>
19 19
     <li><?php esc_html_e('Phone number', 'event_espresso'); ?></li>
20 20
     <li><?php
21
-        esc_html_e(
22
-            'Location and traffic data (including partial IP address and browser type)',
23
-            'event_espresso'
24
-        ); ?>
21
+		esc_html_e(
22
+			'Location and traffic data (including partial IP address and browser type)',
23
+			'event_espresso'
24
+		); ?>
25 25
     </li>
26 26
     <li><?php
27
-        esc_html_e(
28
-            'Any other details that might be requested from you for the purpose of processing your registration or ticket purchase',
29
-            'event_espresso'
30
-        ); ?>
27
+		esc_html_e(
28
+			'Any other details that might be requested from you for the purpose of processing your registration or ticket purchase',
29
+			'event_espresso'
30
+		); ?>
31 31
     </li>
32 32
 </ul>
33 33
 
@@ -36,101 +36,101 @@  discard block
 block discarded – undo
36 36
     <li><?php esc_html_e('Send you important account/purchase/service information.', 'event_espresso'); ?></li>
37 37
     <li><?php esc_html_e('Respond to your queries, refund requests, or complaints.', 'event_espresso'); ?></li>
38 38
     <li><?php
39
-        esc_html_e(
40
-            'Process payments and prevent fraudulent transactions. We do this on the basis of our legitimate business interests.',
41
-            'event_espresso'
42
-        ); ?></li>
39
+		esc_html_e(
40
+			'Process payments and prevent fraudulent transactions. We do this on the basis of our legitimate business interests.',
41
+			'event_espresso'
42
+		); ?></li>
43 43
     <li><?php
44
-        esc_html_e(
45
-            'Set up and administer your account, provide technical and customer support, and to verify your identity.',
46
-            'event_espresso'
47
-        ); ?></li>
44
+		esc_html_e(
45
+			'Set up and administer your account, provide technical and customer support, and to verify your identity.',
46
+			'event_espresso'
47
+		); ?></li>
48 48
 </ul>
49 49
 
50 50
 <?php if (! empty($active_onsite_payment_methods) || ! empty($active_offsite_payment_methods)) { ?>
51 51
     <h2><?php esc_html_e('Billing Information', 'event_espresso'); ?> </h2>
52 52
     <?php
53
-    // if onsite or offsite payment methods are active
54
-    if (! empty($active_onsite_payment_methods)) { ?>
53
+	// if onsite or offsite payment methods are active
54
+	if (! empty($active_onsite_payment_methods)) { ?>
55 55
         <p><?php
56
-            esc_html_e(
57
-                'In order to process payments, we collect billing information on-site. Sensitive billing information is not stored on our server, but may be handled while in-transit to the payment processing server.',
58
-                'event_espresso'
59
-            ); ?></p>
56
+			esc_html_e(
57
+				'In order to process payments, we collect billing information on-site. Sensitive billing information is not stored on our server, but may be handled while in-transit to the payment processing server.',
58
+				'event_espresso'
59
+			); ?></p>
60 60
         <p><?php
61
-            printf(
62
-                esc_html_x(
63
-                    'Please see the privacy policy of %1$s.',
64
-                    'Please see the privacy policy of PayPal Pro',
65
-                    'event_espresso'
66
-                ),
67
-                implode(
68
-                    ', ',
69
-                    array_merge(
70
-                        $active_onsite_payment_methods,
71
-                        $active_offsite_payment_methods
72
-                    )
73
-                )
74
-            ); ?></p>
61
+			printf(
62
+				esc_html_x(
63
+					'Please see the privacy policy of %1$s.',
64
+					'Please see the privacy policy of PayPal Pro',
65
+					'event_espresso'
66
+				),
67
+				implode(
68
+					', ',
69
+					array_merge(
70
+						$active_onsite_payment_methods,
71
+						$active_offsite_payment_methods
72
+					)
73
+				)
74
+			); ?></p>
75 75
         <p><?php
76
-            esc_html_e(
77
-                'Masked billing information may be stored on our servers (eg only the last 4 digits of credit card numbers are stored: **** **** **** 1234).',
78
-                'event_espresso'
79
-            ); ?></p>
76
+			esc_html_e(
77
+				'Masked billing information may be stored on our servers (eg only the last 4 digits of credit card numbers are stored: **** **** **** 1234).',
78
+				'event_espresso'
79
+			); ?></p>
80 80
     <?php } elseif (! empty($active_offsite_payment_methods)) { // IF OFFSITE PAYMENT METHOD ACTIVE ?>
81 81
         <p><?php
82
-            printf(
83
-                esc_html_x(
84
-                    'Billing information is sent directly to the payment processor, and is not handled by our servers. Please see the privacy policy of %1$s.',
85
-                    'Billing information is sent directly to the payment processor, and is not handled by our servers. Please see the privacy policy of PayPal Pro.',
86
-                    'event_espresso'
87
-                ),
88
-                implode(', ', $active_offsite_payment_methods)
89
-            ); ?></p>
82
+			printf(
83
+				esc_html_x(
84
+					'Billing information is sent directly to the payment processor, and is not handled by our servers. Please see the privacy policy of %1$s.',
85
+					'Billing information is sent directly to the payment processor, and is not handled by our servers. Please see the privacy policy of PayPal Pro.',
86
+					'event_espresso'
87
+				),
88
+				implode(', ', $active_offsite_payment_methods)
89
+			); ?></p>
90 90
     <?php } ?>
91 91
     <h2><?php esc_html_e('Payment Logging', 'event_espresso'); ?></h2>
92 92
     <p><?php
93
-        esc_html_e(
94
-            'Site administrators may keep a log of communications with the payment processors in order to verify payments are being processed correctly. These logs are automatically deleted after a week.',
95
-            'event_espresso'
96
-        ); ?></p>
93
+		esc_html_e(
94
+			'Site administrators may keep a log of communications with the payment processors in order to verify payments are being processed correctly. These logs are automatically deleted after a week.',
95
+			'event_espresso'
96
+		); ?></p>
97 97
 <?php } ?>
98 98
 
99 99
 <h2><?php esc_html_e('Event Registration Cookies', 'event_espresso'); ?></h2>
100 100
 <p><?php
101
-    printf(
102
-        esc_html_x(
103
-            'When you begin registering for an event and select a ticket quantity, a cookie will be used to track your registration. This cookie lasts %1$s.',
104
-            'When you begin registering for an event and select a ticket quantity, a cookie will be used to track your registration. This cookie lasts 2 hours.',
105
-            'event_espresso'
106
-        ),
107
-        $session_lifespan
108
-    ); ?></p>
101
+	printf(
102
+		esc_html_x(
103
+			'When you begin registering for an event and select a ticket quantity, a cookie will be used to track your registration. This cookie lasts %1$s.',
104
+			'When you begin registering for an event and select a ticket quantity, a cookie will be used to track your registration. This cookie lasts 2 hours.',
105
+			'event_espresso'
106
+		),
107
+		$session_lifespan
108
+	); ?></p>
109 109
 
110 110
 <h2><?php esc_html_e('Email History Data', 'event_espresso'); ?></h2>
111 111
 <p><?php
112
-    esc_html_e(
113
-        'We keep a record of the emails sent to you. This is to ensure communication is successfully sent and its information is accurate.',
114
-        'event_espresso'
115
-    ); ?></p>
112
+	esc_html_e(
113
+		'We keep a record of the emails sent to you. This is to ensure communication is successfully sent and its information is accurate.',
114
+		'event_espresso'
115
+	); ?></p>
116 116
 
117 117
 <h2><?php esc_html_e('Event Check-In Record', 'event_espresso'); ?></h2>
118 118
 <p><?php
119
-    esc_html_e(
120
-        'When you attend an event, an event manager may record the time you check in or out of the event.',
121
-        'event_espresso'
122
-    ); ?></p>
119
+	esc_html_e(
120
+		'When you attend an event, an event manager may record the time you check in or out of the event.',
121
+		'event_espresso'
122
+	); ?></p>
123 123
 
124 124
 <h2><?php esc_html_e('Event Registration Data Retention', 'event_espresso'); ?></h2>
125 125
 <p><?php
126
-    esc_html_e(
127
-        'Personal data is stored at least until the date of the event, and may be kept indefinitely in case of future registrations.',
128
-        'event_espresso'
129
-    ); ?></p>
126
+	esc_html_e(
127
+		'Personal data is stored at least until the date of the event, and may be kept indefinitely in case of future registrations.',
128
+		'event_espresso'
129
+	); ?></p>
130 130
 
131 131
 <h2><?php esc_html_e('Event Registration Data Erasure and Export', 'event_espresso'); ?></h2>
132 132
 <p><?php
133
-    esc_html_e(
134
-        'You have the right to request your personal data be sent to you electronically, and the right to request your registration data be erased after the event. To do so, please contact the event manager or site administrator.',
135
-        'event_espresso'
136
-    ); ?></p>
133
+	esc_html_e(
134
+		'You have the right to request your personal data be sent to you electronically, and the right to request your registration data be erased after the event. To do so, please contact the event manager or site administrator.',
135
+		'event_espresso'
136
+	); ?></p>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
         ); ?></li>
48 48
 </ul>
49 49
 
50
-<?php if (! empty($active_onsite_payment_methods) || ! empty($active_offsite_payment_methods)) { ?>
50
+<?php if ( ! empty($active_onsite_payment_methods) || ! empty($active_offsite_payment_methods)) { ?>
51 51
     <h2><?php esc_html_e('Billing Information', 'event_espresso'); ?> </h2>
52 52
     <?php
53 53
     // if onsite or offsite payment methods are active
54
-    if (! empty($active_onsite_payment_methods)) { ?>
54
+    if ( ! empty($active_onsite_payment_methods)) { ?>
55 55
         <p><?php
56 56
             esc_html_e(
57 57
                 'In order to process payments, we collect billing information on-site. Sensitive billing information is not stored on our server, but may be handled while in-transit to the payment processing server.',
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                 'Masked billing information may be stored on our servers (eg only the last 4 digits of credit card numbers are stored: **** **** **** 1234).',
78 78
                 'event_espresso'
79 79
             ); ?></p>
80
-    <?php } elseif (! empty($active_offsite_payment_methods)) { // IF OFFSITE PAYMENT METHOD ACTIVE ?>
80
+    <?php } elseif ( ! empty($active_offsite_payment_methods)) { // IF OFFSITE PAYMENT METHOD ACTIVE ?>
81 81
         <p><?php
82 82
             printf(
83 83
                 esc_html_x(
Please login to merge, or discard this patch.
public/Espresso_Arabica_2014/loop-espresso_events.php 2 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -11,48 +11,48 @@
 block discarded – undo
11 11
  * @version     4+
12 12
  */
13 13
 if (have_posts()) :
14
-    if (apply_filters('FHEE__archive_espresso_events_template__show_header', true)) : ?>
14
+	if (apply_filters('FHEE__archive_espresso_events_template__show_header', true)) : ?>
15 15
         <header class="page-header">
16 16
             <h1 class="page-title">
17 17
                 <?php
18
-                if (is_day()) :
19
-                    printf(esc_html__('Today\'s Events: %s', 'event_espresso'), get_the_date());
20
-                elseif (is_month()) :
21
-                    printf(
22
-                        esc_html__('Events This Month: %s', 'event_espresso'),
23
-                        get_the_date(_x('F Y', 'monthly archives date format', 'event_espresso'))
24
-                    );
25
-                elseif (is_year()) :
26
-                    printf(
27
-                        esc_html__('Events This Year: %s', 'event_espresso'),
28
-                        get_the_date(_x('Y', 'yearly archives date format', 'event_espresso'))
29
-                    );
30
-                else :
31
-                    echo apply_filters(
32
-                        'FHEE__archive_espresso_events_template__upcoming_events_h1',
33
-                        esc_html__('Upcoming Events', 'event_espresso')
34
-                    );
35
-                endif;
36
-                ?>
18
+				if (is_day()) :
19
+					printf(esc_html__('Today\'s Events: %s', 'event_espresso'), get_the_date());
20
+				elseif (is_month()) :
21
+					printf(
22
+						esc_html__('Events This Month: %s', 'event_espresso'),
23
+						get_the_date(_x('F Y', 'monthly archives date format', 'event_espresso'))
24
+					);
25
+				elseif (is_year()) :
26
+					printf(
27
+						esc_html__('Events This Year: %s', 'event_espresso'),
28
+						get_the_date(_x('Y', 'yearly archives date format', 'event_espresso'))
29
+					);
30
+				else :
31
+					echo apply_filters(
32
+						'FHEE__archive_espresso_events_template__upcoming_events_h1',
33
+						esc_html__('Upcoming Events', 'event_espresso')
34
+					);
35
+				endif;
36
+				?>
37 37
             </h1>
38 38
 
39 39
         </header><!-- .page-header -->
40 40
 
41 41
         <?php
42
-    endif;
43
-    // allow other stuff
44
-    do_action('AHEE__archive_espresso_events_template__before_loop');
45
-    // Start the Loop.
46
-    while (have_posts()) : the_post();
47
-        // Include the post TYPE-specific template for the content.
48
-        espresso_get_template_part('content', 'espresso_events-shortcode');
49
-    endwhile;
50
-    // Previous/next page navigation.
51
-    espresso_pagination();
52
-    // allow moar other stuff
53
-    do_action('AHEE__archive_espresso_events_template__after_loop');
42
+	endif;
43
+	// allow other stuff
44
+	do_action('AHEE__archive_espresso_events_template__before_loop');
45
+	// Start the Loop.
46
+	while (have_posts()) : the_post();
47
+		// Include the post TYPE-specific template for the content.
48
+		espresso_get_template_part('content', 'espresso_events-shortcode');
49
+	endwhile;
50
+	// Previous/next page navigation.
51
+	espresso_pagination();
52
+	// allow moar other stuff
53
+	do_action('AHEE__archive_espresso_events_template__after_loop');
54 54
 else :
55
-    // If no content, include the "No posts found" template.
56
-    espresso_get_template_part('content', 'none');
55
+	// If no content, include the "No posts found" template.
56
+	espresso_get_template_part('content', 'none');
57 57
 endif;
58 58
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,11 +27,13 @@  discard block
 block discarded – undo
27 27
                         esc_html__('Events This Year: %s', 'event_espresso'),
28 28
                         get_the_date(_x('Y', 'yearly archives date format', 'event_espresso'))
29 29
                     );
30
-                else :
30
+                else {
31
+                	:
31 32
                     echo apply_filters(
32 33
                         'FHEE__archive_espresso_events_template__upcoming_events_h1',
33 34
                         esc_html__('Upcoming Events', 'event_espresso')
34 35
                     );
36
+                }
35 37
                 endif;
36 38
                 ?>
37 39
             </h1>
@@ -51,8 +53,10 @@  discard block
 block discarded – undo
51 53
     espresso_pagination();
52 54
     // allow moar other stuff
53 55
     do_action('AHEE__archive_espresso_events_template__after_loop');
54
-else :
56
+else {
57
+	:
55 58
     // If no content, include the "No posts found" template.
56 59
     espresso_get_template_part('content', 'none');
60
+}
57 61
 endif;
58 62
 
Please login to merge, or discard this patch.
public/Espresso_Arabica_2014/functions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
  * @ link			http://www.eventespresso.com
10 10
  * @ version		4+
11 11
  */
12
-define( 'EE_THEME_FUNCTIONS_LOADED', TRUE );
12
+define('EE_THEME_FUNCTIONS_LOADED', TRUE);
13 13
 
14
-if ( ! function_exists( 'espresso_pagination' ) ) {
14
+if ( ! function_exists('espresso_pagination')) {
15 15
 	/**
16 16
 	 *    espresso_pagination
17 17
 	 *
@@ -23,21 +23,21 @@  discard block
 block discarded – undo
23 23
 		$big = 999999999; // need an unlikely integer
24 24
 		$pagination = paginate_links(
25 25
 			array(
26
-				'base'         => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
26
+				'base'         => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
27 27
 				'format'       => '?paged=%#%',
28
-				'current'      => max( 1, get_query_var( 'paged' ) ),
28
+				'current'      => max(1, get_query_var('paged')),
29 29
 				'total'        => $wp_query->max_num_pages,
30 30
 				'show_all'     => true,
31 31
 				'end_size'     => 10,
32 32
 				'mid_size'     => 6,
33 33
 				'prev_next'    => true,
34
-				'prev_text'    => esc_html__( '&lsaquo; PREV', 'event_espresso' ),
35
-				'next_text'    => esc_html__( 'NEXT &rsaquo;', 'event_espresso' ),
34
+				'prev_text'    => esc_html__('&lsaquo; PREV', 'event_espresso'),
35
+				'next_text'    => esc_html__('NEXT &rsaquo;', 'event_espresso'),
36 36
 				'type'         => 'plain',
37 37
 				'add_args'     => false,
38 38
 				'add_fragment' => ''
39 39
 			)
40 40
 		);
41
-		echo ! empty( $pagination ) ? '<div class="ee-pagination-dv ee-clear-float">' . $pagination . '</div>' : '';
41
+		echo ! empty($pagination) ? '<div class="ee-pagination-dv ee-clear-float">'.$pagination.'</div>' : '';
42 42
 	}
43 43
 }
44 44
\ No newline at end of file
Please login to merge, or discard this patch.
core/libraries/line_item_filters/EE_Line_Item_Filter_Processor.class.php 1 patch
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -36,88 +36,88 @@
 block discarded – undo
36 36
 class EE_Line_Item_Filter_Processor
37 37
 {
38 38
 
39
-    /**
40
-     * @type EE_Line_Item_Filter_Collection $line_item_filters
41
-     */
42
-    protected $line_item_filters;
39
+	/**
40
+	 * @type EE_Line_Item_Filter_Collection $line_item_filters
41
+	 */
42
+	protected $line_item_filters;
43 43
 
44
-    /**
45
-     * @type EEI_Line_Item $grand_total_line_item
46
-     */
47
-    protected $grand_total_line_item;
44
+	/**
45
+	 * @type EEI_Line_Item $grand_total_line_item
46
+	 */
47
+	protected $grand_total_line_item;
48 48
 
49 49
 
50
-    /**
51
-     * EE_Line_Item_Filter_Processor constructor.
52
-     *
53
-     * @param \EE_Line_Item_Filter_Collection $line_item_filters
54
-     * @param \EEI_Line_Item                  $grand_total_line_item
55
-     * @throws \EE_Error
56
-     */
57
-    public function __construct(EE_Line_Item_Filter_Collection $line_item_filters, EEI_Line_Item $grand_total_line_item)
58
-    {
59
-        $this->line_item_filters = $line_item_filters;
60
-        if ($grand_total_line_item->type() !== EEM_Line_Item::type_total) {
61
-            throw new EE_Error(esc_html__('A Line Item of the type total is required', 'event_espresso'));
62
-        }
63
-        $this->grand_total_line_item = $this->clone_and_reset_line_item_tree($grand_total_line_item);
64
-    }
50
+	/**
51
+	 * EE_Line_Item_Filter_Processor constructor.
52
+	 *
53
+	 * @param \EE_Line_Item_Filter_Collection $line_item_filters
54
+	 * @param \EEI_Line_Item                  $grand_total_line_item
55
+	 * @throws \EE_Error
56
+	 */
57
+	public function __construct(EE_Line_Item_Filter_Collection $line_item_filters, EEI_Line_Item $grand_total_line_item)
58
+	{
59
+		$this->line_item_filters = $line_item_filters;
60
+		if ($grand_total_line_item->type() !== EEM_Line_Item::type_total) {
61
+			throw new EE_Error(esc_html__('A Line Item of the type total is required', 'event_espresso'));
62
+		}
63
+		$this->grand_total_line_item = $this->clone_and_reset_line_item_tree($grand_total_line_item);
64
+	}
65 65
 
66 66
 
67
-    /**
68
-     * clone_and_reset_line_item_tree
69
-     *
70
-     * @param \EEI_Line_Item $line_item
71
-     * @return \EEI_Line_Item
72
-     */
73
-    protected function clone_and_reset_line_item_tree(EEI_Line_Item $line_item)
74
-    {
75
-        $cloned_line_item = $this->clone_and_reset_line_item($line_item);
76
-        foreach ($line_item->children() as $child_line_item) {
77
-            $cloned_line_item->add_child_line_item($this->clone_and_reset_line_item_tree($child_line_item));
78
-        }
79
-        return $cloned_line_item;
80
-    }
67
+	/**
68
+	 * clone_and_reset_line_item_tree
69
+	 *
70
+	 * @param \EEI_Line_Item $line_item
71
+	 * @return \EEI_Line_Item
72
+	 */
73
+	protected function clone_and_reset_line_item_tree(EEI_Line_Item $line_item)
74
+	{
75
+		$cloned_line_item = $this->clone_and_reset_line_item($line_item);
76
+		foreach ($line_item->children() as $child_line_item) {
77
+			$cloned_line_item->add_child_line_item($this->clone_and_reset_line_item_tree($child_line_item));
78
+		}
79
+		return $cloned_line_item;
80
+	}
81 81
 
82 82
 
83
-    /**
84
-     * clone_and_reset_line_item
85
-     *
86
-     * clones the incoming object
87
-     * resets any fields that represent database primary keys
88
-     * resets total
89
-     *
90
-     * @param \EEI_Line_Item $line_item
91
-     * @return \EEI_Line_Item
92
-     */
93
-    protected function clone_and_reset_line_item(EEI_Line_Item $line_item)
94
-    {
95
-        // we don't actually want to work with the original line item, so clone it
96
-        $cloned_line_item = clone $line_item;
97
-        $cloned_line_item->set('LIN_ID', null);
98
-        $cloned_line_item->set('LIN_parent', null);
99
-        $cloned_line_item->clear_related_line_item_cache();
100
-        foreach (array_keys(EEM_Line_Item::instance()->relation_settings()) as $relation_name) {
101
-            $cloned_line_item->clear_cache($relation_name, null, true);
102
-        }
103
-        $cloned_line_item->set_allow_persist(false);
104
-        return $cloned_line_item;
105
-    }
83
+	/**
84
+	 * clone_and_reset_line_item
85
+	 *
86
+	 * clones the incoming object
87
+	 * resets any fields that represent database primary keys
88
+	 * resets total
89
+	 *
90
+	 * @param \EEI_Line_Item $line_item
91
+	 * @return \EEI_Line_Item
92
+	 */
93
+	protected function clone_and_reset_line_item(EEI_Line_Item $line_item)
94
+	{
95
+		// we don't actually want to work with the original line item, so clone it
96
+		$cloned_line_item = clone $line_item;
97
+		$cloned_line_item->set('LIN_ID', null);
98
+		$cloned_line_item->set('LIN_parent', null);
99
+		$cloned_line_item->clear_related_line_item_cache();
100
+		foreach (array_keys(EEM_Line_Item::instance()->relation_settings()) as $relation_name) {
101
+			$cloned_line_item->clear_cache($relation_name, null, true);
102
+		}
103
+		$cloned_line_item->set_allow_persist(false);
104
+		return $cloned_line_item;
105
+	}
106 106
 
107 107
 
108
-    /**
109
-     * process
110
-     *
111
-     * @return EEI_Line_Item
112
-     */
113
-    public function process()
114
-    {
115
-        $this->line_item_filters->rewind();
116
-        while ($this->line_item_filters->valid()) {
117
-            $this->grand_total_line_item = $this->line_item_filters->current()->process($this->grand_total_line_item);
118
-            $this->line_item_filters->next();
119
-        }
120
-        $this->grand_total_line_item->recalculate_total_including_taxes();
121
-        return $this->grand_total_line_item;
122
-    }
108
+	/**
109
+	 * process
110
+	 *
111
+	 * @return EEI_Line_Item
112
+	 */
113
+	public function process()
114
+	{
115
+		$this->line_item_filters->rewind();
116
+		while ($this->line_item_filters->valid()) {
117
+			$this->grand_total_line_item = $this->line_item_filters->current()->process($this->grand_total_line_item);
118
+			$this->line_item_filters->next();
119
+		}
120
+		$this->grand_total_line_item->recalculate_total_including_taxes();
121
+		return $this->grand_total_line_item;
122
+	}
123 123
 }
Please login to merge, or discard this patch.
core/libraries/messages/data_class/EE_Messages_REG_incoming_data.class.php 2 patches
Indentation   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -18,137 +18,137 @@
 block discarded – undo
18 18
 
19 19
 
20 20
 
21
-    /**
22
-     * For the constructor of this special preview class.
23
-     *
24
-     * The data is expected to be an array that came from the request data
25
-     * and should have at least one property from the list looked for.
26
-     *
27
-     * @param EE_Registration|array $data
28
-     * @throws \EE_Error
29
-     */
30
-    public function __construct($data)
31
-    {
32
-        $filtered_reg_status = null;
33
-
34
-        if (! is_array($data) && $data instanceof EE_Registration) {
35
-            $this->reg_obj = $data;
36
-        } else {
37
-            $this->reg_obj = is_array($data) && isset($data[0]) && $data[0] instanceof EE_Registration ? $data[0] : null;
38
-            $filtered_reg_status = is_array($data) && ! empty($data[1]) ? $data[1] : null;
39
-        }
40
-
41
-        if (! $this->reg_obj instanceof EE_Registration) {
42
-            throw new EE_Error(
43
-                sprintf(
44
-                    esc_html__('%1$s requires the incoming data argument to be an instance of %2$s or an array where the first value is an instance of %2$s', 'event_espresso'),
45
-                    'EE_Messages_REG_incoming_data',
46
-                    'EE_Registration'
47
-                )
48
-            );
49
-        }
50
-
51
-        $data = array(
52
-            'reg_obj' => $this->reg_obj,
53
-            'filtered_reg_status' => $filtered_reg_status
54
-            );
55
-
56
-        parent::__construct($data);
57
-    }
58
-
59
-    /**
60
-     * Returns database safe representation of the data later used to when instantiating this object.
61
-     *
62
-     * @param mixed $data The incoming data to be prepped.
63
-     *
64
-     * @return array   The prepped data for db
65
-     */
66
-    public static function convert_data_for_persistent_storage($data)
67
-    {
68
-        $prepped_data = array();
69
-        if (! is_array($data) && $data instanceof EE_Registration) {
70
-            $prepped_data['Registration'] = $data->ID();
71
-            return $prepped_data;
72
-        } elseif (! is_array($data)) {
73
-            return array();
74
-        } else {
75
-            if ($data[0] instanceof EE_Registration) {
76
-                $prepped_data['Registration'] = $data[0];
77
-            }
78
-            if (! empty($data[1])) {
79
-                $prepped_data['filter'] = $data[1];
80
-            }
81
-        }
82
-
83
-        return $prepped_data;
84
-    }
85
-
86
-    /**
87
-     * Data that has been stored in persistent storage that was prepped by _convert_data_for_persistent_storage
88
-     * can be sent into this method and converted back into the format used for instantiating with this data handler.
89
-     *
90
-     * @param $data
91
-     *
92
-     * @return mixed
93
-     */
94
-    public static function convert_data_from_persistent_storage($data)
95
-    {
96
-        $registration = null;
97
-        // $data['Registration'] could be either an ID (back compat) or a registration object (prepped using old system).
98
-        if (isset($data['Registration'])) {
99
-            $registration = $data['Registration'] instanceof EE_Registration
100
-                ? $data['Registration']
101
-                : EEM_Registration::instance()->get_one_by_ID($data['Registration']);
102
-        }
103
-        $prepped_data = array(
104
-            0 => $registration,
105
-            1 => isset($data['filter']) ? $data['filter'] : null
106
-        );
107
-        return $prepped_data;
108
-    }
109
-
110
-
111
-    /**
112
-     * This will just setup the _events property in the expected format.
113
-     * @return void
114
-     */
115
-    protected function _setup_data()
116
-    {
117
-
118
-        // now let's loop and set up the _events property.  At the same time we'll set up attendee properties.
119
-        $this->filtered_reg_status = $this->_data['filtered_reg_status'];
120
-        // get txn
121
-        $this->txn = $this->reg_obj->transaction();
122
-        // possible session stuff?
123
-        $session = $this->txn->session_data();
124
-        $session_data =  $session instanceof EE_Session ? $session->get_session_data() : array();
125
-
126
-        // other data from the session (if possible)
127
-        $this->user_id = isset($session_data['user_id']) ? $session_data['user_id'] : '';
128
-        $this->ip_address = isset($session_data['ip_address']) ? $session_data['ip_address'] : '';
129
-        $this->user_agent = isset($session_data['user_agent']) ? $session_data['user_agent'] : '';
130
-        $this->init_access = $this->last_access = '';
131
-
132
-        $this->payment = $this->txn->get_first_related('Payment');
133
-        // if there is no payments associated with the transaction
134
-        // then we just create a default payment object for potential parsing.
135
-        $this->payment = empty($this->payment)
136
-            ? EE_Payment::new_instance(
137
-                array(
138
-                    'STS_ID'               => EEM_Payment::status_id_pending,
139
-                    'PAY_timestamp'        => time(),
140
-                    'PMD_ID'               => $this->txn->payment_method_ID(),
141
-                    'PAY_gateway_response' => $this->txn->gateway_response_on_transaction(),
142
-                )
143
-            )
144
-            : $this->payment;
145
-
146
-
147
-        // get reg_objs for txn
148
-        $this->reg_objs = $this->txn->registrations();
149
-
150
-        // now we can set things up like we do for other handlers
151
-
152
-        $this->_assemble_data();
153
-    }
21
+	/**
22
+	 * For the constructor of this special preview class.
23
+	 *
24
+	 * The data is expected to be an array that came from the request data
25
+	 * and should have at least one property from the list looked for.
26
+	 *
27
+	 * @param EE_Registration|array $data
28
+	 * @throws \EE_Error
29
+	 */
30
+	public function __construct($data)
31
+	{
32
+		$filtered_reg_status = null;
33
+
34
+		if (! is_array($data) && $data instanceof EE_Registration) {
35
+			$this->reg_obj = $data;
36
+		} else {
37
+			$this->reg_obj = is_array($data) && isset($data[0]) && $data[0] instanceof EE_Registration ? $data[0] : null;
38
+			$filtered_reg_status = is_array($data) && ! empty($data[1]) ? $data[1] : null;
39
+		}
40
+
41
+		if (! $this->reg_obj instanceof EE_Registration) {
42
+			throw new EE_Error(
43
+				sprintf(
44
+					esc_html__('%1$s requires the incoming data argument to be an instance of %2$s or an array where the first value is an instance of %2$s', 'event_espresso'),
45
+					'EE_Messages_REG_incoming_data',
46
+					'EE_Registration'
47
+				)
48
+			);
49
+		}
50
+
51
+		$data = array(
52
+			'reg_obj' => $this->reg_obj,
53
+			'filtered_reg_status' => $filtered_reg_status
54
+			);
55
+
56
+		parent::__construct($data);
57
+	}
58
+
59
+	/**
60
+	 * Returns database safe representation of the data later used to when instantiating this object.
61
+	 *
62
+	 * @param mixed $data The incoming data to be prepped.
63
+	 *
64
+	 * @return array   The prepped data for db
65
+	 */
66
+	public static function convert_data_for_persistent_storage($data)
67
+	{
68
+		$prepped_data = array();
69
+		if (! is_array($data) && $data instanceof EE_Registration) {
70
+			$prepped_data['Registration'] = $data->ID();
71
+			return $prepped_data;
72
+		} elseif (! is_array($data)) {
73
+			return array();
74
+		} else {
75
+			if ($data[0] instanceof EE_Registration) {
76
+				$prepped_data['Registration'] = $data[0];
77
+			}
78
+			if (! empty($data[1])) {
79
+				$prepped_data['filter'] = $data[1];
80
+			}
81
+		}
82
+
83
+		return $prepped_data;
84
+	}
85
+
86
+	/**
87
+	 * Data that has been stored in persistent storage that was prepped by _convert_data_for_persistent_storage
88
+	 * can be sent into this method and converted back into the format used for instantiating with this data handler.
89
+	 *
90
+	 * @param $data
91
+	 *
92
+	 * @return mixed
93
+	 */
94
+	public static function convert_data_from_persistent_storage($data)
95
+	{
96
+		$registration = null;
97
+		// $data['Registration'] could be either an ID (back compat) or a registration object (prepped using old system).
98
+		if (isset($data['Registration'])) {
99
+			$registration = $data['Registration'] instanceof EE_Registration
100
+				? $data['Registration']
101
+				: EEM_Registration::instance()->get_one_by_ID($data['Registration']);
102
+		}
103
+		$prepped_data = array(
104
+			0 => $registration,
105
+			1 => isset($data['filter']) ? $data['filter'] : null
106
+		);
107
+		return $prepped_data;
108
+	}
109
+
110
+
111
+	/**
112
+	 * This will just setup the _events property in the expected format.
113
+	 * @return void
114
+	 */
115
+	protected function _setup_data()
116
+	{
117
+
118
+		// now let's loop and set up the _events property.  At the same time we'll set up attendee properties.
119
+		$this->filtered_reg_status = $this->_data['filtered_reg_status'];
120
+		// get txn
121
+		$this->txn = $this->reg_obj->transaction();
122
+		// possible session stuff?
123
+		$session = $this->txn->session_data();
124
+		$session_data =  $session instanceof EE_Session ? $session->get_session_data() : array();
125
+
126
+		// other data from the session (if possible)
127
+		$this->user_id = isset($session_data['user_id']) ? $session_data['user_id'] : '';
128
+		$this->ip_address = isset($session_data['ip_address']) ? $session_data['ip_address'] : '';
129
+		$this->user_agent = isset($session_data['user_agent']) ? $session_data['user_agent'] : '';
130
+		$this->init_access = $this->last_access = '';
131
+
132
+		$this->payment = $this->txn->get_first_related('Payment');
133
+		// if there is no payments associated with the transaction
134
+		// then we just create a default payment object for potential parsing.
135
+		$this->payment = empty($this->payment)
136
+			? EE_Payment::new_instance(
137
+				array(
138
+					'STS_ID'               => EEM_Payment::status_id_pending,
139
+					'PAY_timestamp'        => time(),
140
+					'PMD_ID'               => $this->txn->payment_method_ID(),
141
+					'PAY_gateway_response' => $this->txn->gateway_response_on_transaction(),
142
+				)
143
+			)
144
+			: $this->payment;
145
+
146
+
147
+		// get reg_objs for txn
148
+		$this->reg_objs = $this->txn->registrations();
149
+
150
+		// now we can set things up like we do for other handlers
151
+
152
+		$this->_assemble_data();
153
+	}
154 154
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
     {
32 32
         $filtered_reg_status = null;
33 33
 
34
-        if (! is_array($data) && $data instanceof EE_Registration) {
34
+        if ( ! is_array($data) && $data instanceof EE_Registration) {
35 35
             $this->reg_obj = $data;
36 36
         } else {
37 37
             $this->reg_obj = is_array($data) && isset($data[0]) && $data[0] instanceof EE_Registration ? $data[0] : null;
38 38
             $filtered_reg_status = is_array($data) && ! empty($data[1]) ? $data[1] : null;
39 39
         }
40 40
 
41
-        if (! $this->reg_obj instanceof EE_Registration) {
41
+        if ( ! $this->reg_obj instanceof EE_Registration) {
42 42
             throw new EE_Error(
43 43
                 sprintf(
44 44
                     esc_html__('%1$s requires the incoming data argument to be an instance of %2$s or an array where the first value is an instance of %2$s', 'event_espresso'),
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
     public static function convert_data_for_persistent_storage($data)
67 67
     {
68 68
         $prepped_data = array();
69
-        if (! is_array($data) && $data instanceof EE_Registration) {
69
+        if ( ! is_array($data) && $data instanceof EE_Registration) {
70 70
             $prepped_data['Registration'] = $data->ID();
71 71
             return $prepped_data;
72
-        } elseif (! is_array($data)) {
72
+        } elseif ( ! is_array($data)) {
73 73
             return array();
74 74
         } else {
75 75
             if ($data[0] instanceof EE_Registration) {
76 76
                 $prepped_data['Registration'] = $data[0];
77 77
             }
78
-            if (! empty($data[1])) {
78
+            if ( ! empty($data[1])) {
79 79
                 $prepped_data['filter'] = $data[1];
80 80
             }
81 81
         }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         $this->txn = $this->reg_obj->transaction();
122 122
         // possible session stuff?
123 123
         $session = $this->txn->session_data();
124
-        $session_data =  $session instanceof EE_Session ? $session->get_session_data() : array();
124
+        $session_data = $session instanceof EE_Session ? $session->get_session_data() : array();
125 125
 
126 126
         // other data from the session (if possible)
127 127
         $this->user_id = isset($session_data['user_id']) ? $session_data['user_id'] : '';
Please login to merge, or discard this patch.