@@ -15,23 +15,23 @@ |
||
15 | 15 | class UpdateRegistrationService extends DomainService |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * @param \EE_Registration $registration |
|
20 | - * @return bool |
|
21 | - */ |
|
22 | - public function updateRegistrationAndTransaction(\EE_Registration $registration) |
|
23 | - { |
|
24 | - $transaction = $registration->transaction(); |
|
25 | - // reset transaction status back to incomplete |
|
26 | - $transaction->set_status(\EEM_Transaction::incomplete_status_code); |
|
27 | - // update transaction and all line item totals and subtotals |
|
28 | - $transaction->total_line_item()->recalculate_total_including_taxes(); |
|
29 | - // maybe update status, but don't save transaction just yet |
|
30 | - $transaction->update_status_based_on_total_paid(); |
|
31 | - /** @type \EE_Registration_Processor $registration_processor */ |
|
32 | - $registration_processor = \EE_Registry::instance()->load_class('Registration_Processor'); |
|
33 | - $registration_processor->update_registration_final_prices($transaction); |
|
34 | - $registration_processor->update_registration_status_and_trigger_notifications($registration); |
|
35 | - return true; |
|
36 | - } |
|
18 | + /** |
|
19 | + * @param \EE_Registration $registration |
|
20 | + * @return bool |
|
21 | + */ |
|
22 | + public function updateRegistrationAndTransaction(\EE_Registration $registration) |
|
23 | + { |
|
24 | + $transaction = $registration->transaction(); |
|
25 | + // reset transaction status back to incomplete |
|
26 | + $transaction->set_status(\EEM_Transaction::incomplete_status_code); |
|
27 | + // update transaction and all line item totals and subtotals |
|
28 | + $transaction->total_line_item()->recalculate_total_including_taxes(); |
|
29 | + // maybe update status, but don't save transaction just yet |
|
30 | + $transaction->update_status_based_on_total_paid(); |
|
31 | + /** @type \EE_Registration_Processor $registration_processor */ |
|
32 | + $registration_processor = \EE_Registry::instance()->load_class('Registration_Processor'); |
|
33 | + $registration_processor->update_registration_final_prices($transaction); |
|
34 | + $registration_processor->update_registration_status_and_trigger_notifications($registration); |
|
35 | + return true; |
|
36 | + } |
|
37 | 37 | } |
@@ -15,19 +15,19 @@ |
||
15 | 15 | class WordPress extends Basic |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * @param string $email_address |
|
20 | - * @return boolean |
|
21 | - * @throws EmailValidationException |
|
22 | - */ |
|
23 | - public function validate($email_address) |
|
24 | - { |
|
25 | - parent::validate($email_address); |
|
26 | - if (! is_email($email_address)) { |
|
27 | - throw new EmailValidationException( |
|
28 | - esc_html__('The email address provided is not valid.', 'event_espresso') |
|
29 | - ); |
|
30 | - } |
|
31 | - return true; |
|
32 | - } |
|
18 | + /** |
|
19 | + * @param string $email_address |
|
20 | + * @return boolean |
|
21 | + * @throws EmailValidationException |
|
22 | + */ |
|
23 | + public function validate($email_address) |
|
24 | + { |
|
25 | + parent::validate($email_address); |
|
26 | + if (! is_email($email_address)) { |
|
27 | + throw new EmailValidationException( |
|
28 | + esc_html__('The email address provided is not valid.', 'event_espresso') |
|
29 | + ); |
|
30 | + } |
|
31 | + return true; |
|
32 | + } |
|
33 | 33 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | public function validate($email_address) |
24 | 24 | { |
25 | 25 | parent::validate($email_address); |
26 | - if (! is_email($email_address)) { |
|
26 | + if ( ! is_email($email_address)) { |
|
27 | 27 | throw new EmailValidationException( |
28 | 28 | esc_html__('The email address provided is not valid.', 'event_espresso') |
29 | 29 | ); |
@@ -15,26 +15,26 @@ |
||
15 | 15 | class International extends Basic |
16 | 16 | { |
17 | 17 | |
18 | - /** |
|
19 | - * @param string $email_address |
|
20 | - * @return bool |
|
21 | - * @throws \EventEspresso\core\domain\services\validation\email\EmailValidationException |
|
22 | - */ |
|
23 | - public function validate($email_address) |
|
24 | - { |
|
25 | - parent::validate($email_address); |
|
26 | - if (// plz see http://stackoverflow.com/a/24817336 re: the following regex |
|
27 | - ! preg_match( |
|
28 | - // @codingStandardsIgnoreStart |
|
29 | - '/^(?!\.)((?!.*\.{2})[a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\.!#$%&\'*+-\/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\-\.\d]+)((\.([a-zA-Z\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}]){2,63})+)$/u', |
|
30 | - // @codingStandardsIgnoreEnd |
|
31 | - $email_address |
|
32 | - ) |
|
33 | - ) { |
|
34 | - throw new EmailValidationException( |
|
35 | - esc_html__('Email address is invalid.', 'event_espresso') |
|
36 | - ); |
|
37 | - } |
|
38 | - return true; |
|
39 | - } |
|
18 | + /** |
|
19 | + * @param string $email_address |
|
20 | + * @return bool |
|
21 | + * @throws \EventEspresso\core\domain\services\validation\email\EmailValidationException |
|
22 | + */ |
|
23 | + public function validate($email_address) |
|
24 | + { |
|
25 | + parent::validate($email_address); |
|
26 | + if (// plz see http://stackoverflow.com/a/24817336 re: the following regex |
|
27 | + ! preg_match( |
|
28 | + // @codingStandardsIgnoreStart |
|
29 | + '/^(?!\.)((?!.*\.{2})[a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\.!#$%&\'*+-\/=?^_`{|}~\-\d]+)@(?!\.)([a-zA-Z0-9\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}\-\.\d]+)((\.([a-zA-Z\x{0080}-\x{00FF}\x{0100}-\x{017F}\x{0180}-\x{024F}\x{0250}-\x{02AF}\x{0300}-\x{036F}\x{0370}-\x{03FF}\x{0400}-\x{04FF}\x{0500}-\x{052F}\x{0530}-\x{058F}\x{0590}-\x{05FF}\x{0600}-\x{06FF}\x{0700}-\x{074F}\x{0750}-\x{077F}\x{0780}-\x{07BF}\x{07C0}-\x{07FF}\x{0900}-\x{097F}\x{0980}-\x{09FF}\x{0A00}-\x{0A7F}\x{0A80}-\x{0AFF}\x{0B00}-\x{0B7F}\x{0B80}-\x{0BFF}\x{0C00}-\x{0C7F}\x{0C80}-\x{0CFF}\x{0D00}-\x{0D7F}\x{0D80}-\x{0DFF}\x{0E00}-\x{0E7F}\x{0E80}-\x{0EFF}\x{0F00}-\x{0FFF}\x{1000}-\x{109F}\x{10A0}-\x{10FF}\x{1100}-\x{11FF}\x{1200}-\x{137F}\x{1380}-\x{139F}\x{13A0}-\x{13FF}\x{1400}-\x{167F}\x{1680}-\x{169F}\x{16A0}-\x{16FF}\x{1700}-\x{171F}\x{1720}-\x{173F}\x{1740}-\x{175F}\x{1760}-\x{177F}\x{1780}-\x{17FF}\x{1800}-\x{18AF}\x{1900}-\x{194F}\x{1950}-\x{197F}\x{1980}-\x{19DF}\x{19E0}-\x{19FF}\x{1A00}-\x{1A1F}\x{1B00}-\x{1B7F}\x{1D00}-\x{1D7F}\x{1D80}-\x{1DBF}\x{1DC0}-\x{1DFF}\x{1E00}-\x{1EFF}\x{1F00}-\x{1FFF}\x{20D0}-\x{20FF}\x{2100}-\x{214F}\x{2C00}-\x{2C5F}\x{2C60}-\x{2C7F}\x{2C80}-\x{2CFF}\x{2D00}-\x{2D2F}\x{2D30}-\x{2D7F}\x{2D80}-\x{2DDF}\x{2F00}-\x{2FDF}\x{2FF0}-\x{2FFF}\x{3040}-\x{309F}\x{30A0}-\x{30FF}\x{3100}-\x{312F}\x{3130}-\x{318F}\x{3190}-\x{319F}\x{31C0}-\x{31EF}\x{31F0}-\x{31FF}\x{3200}-\x{32FF}\x{3300}-\x{33FF}\x{3400}-\x{4DBF}\x{4DC0}-\x{4DFF}\x{4E00}-\x{9FFF}\x{A000}-\x{A48F}\x{A490}-\x{A4CF}\x{A700}-\x{A71F}\x{A800}-\x{A82F}\x{A840}-\x{A87F}\x{AC00}-\x{D7AF}\x{F900}-\x{FAFF}]){2,63})+)$/u', |
|
30 | + // @codingStandardsIgnoreEnd |
|
31 | + $email_address |
|
32 | + ) |
|
33 | + ) { |
|
34 | + throw new EmailValidationException( |
|
35 | + esc_html__('Email address is invalid.', 'event_espresso') |
|
36 | + ); |
|
37 | + } |
|
38 | + return true; |
|
39 | + } |
|
40 | 40 | } |
@@ -16,65 +16,65 @@ |
||
16 | 16 | class EmailValidationService implements EmailValidatorInterface |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * @var EE_Registration_Config $registration_config |
|
21 | - */ |
|
22 | - protected $registration_config; |
|
19 | + /** |
|
20 | + * @var EE_Registration_Config $registration_config |
|
21 | + */ |
|
22 | + protected $registration_config; |
|
23 | 23 | |
24 | - /** |
|
25 | - * @var Loader $loader |
|
26 | - */ |
|
27 | - protected $loader; |
|
24 | + /** |
|
25 | + * @var Loader $loader |
|
26 | + */ |
|
27 | + protected $loader; |
|
28 | 28 | |
29 | 29 | |
30 | - /** |
|
31 | - * EmailValidationService constructor. |
|
32 | - * Accepts an \EE_Config as an argument. |
|
33 | - * |
|
34 | - * @param EE_Registration_Config $config |
|
35 | - * @param Loader $loader |
|
36 | - */ |
|
37 | - public function __construct(EE_Registration_Config $config, Loader $loader) |
|
38 | - { |
|
39 | - $this->registration_config = $config; |
|
40 | - $this->loader = $loader; |
|
41 | - } |
|
30 | + /** |
|
31 | + * EmailValidationService constructor. |
|
32 | + * Accepts an \EE_Config as an argument. |
|
33 | + * |
|
34 | + * @param EE_Registration_Config $config |
|
35 | + * @param Loader $loader |
|
36 | + */ |
|
37 | + public function __construct(EE_Registration_Config $config, Loader $loader) |
|
38 | + { |
|
39 | + $this->registration_config = $config; |
|
40 | + $this->loader = $loader; |
|
41 | + } |
|
42 | 42 | |
43 | 43 | |
44 | - /** |
|
45 | - * Validates the email address. If it's invalid, an EmailValidationException |
|
46 | - * is thrown that describes why its invalid. |
|
47 | - * |
|
48 | - * @param string $email_address |
|
49 | - * @return boolean |
|
50 | - * @throws EmailValidationException |
|
51 | - */ |
|
52 | - public function validate($email_address) |
|
53 | - { |
|
54 | - // pick the correct validator according to the config |
|
55 | - switch ($this->registration_config->email_validation_level) { |
|
56 | - case 'basic': |
|
57 | - $validator = $this->loader->getShared( |
|
58 | - 'EventEspresso\core\domain\services\validation\email\strategies\Basic' |
|
59 | - ); |
|
60 | - break; |
|
61 | - case 'i18n': |
|
62 | - $validator = $this->loader->getShared( |
|
63 | - 'EventEspresso\core\domain\services\validation\email\strategies\International' |
|
64 | - ); |
|
65 | - break; |
|
66 | - case 'i18n_dns': |
|
67 | - $validator = $this->loader->getShared( |
|
68 | - 'EventEspresso\core\domain\services\validation\email\strategies\InternationalDNS' |
|
69 | - ); |
|
70 | - break; |
|
71 | - case 'wp_default': |
|
72 | - default: |
|
73 | - $validator = $this->loader->getShared( |
|
74 | - 'EventEspresso\core\domain\services\validation\email\strategies\WordPress' |
|
75 | - ); |
|
76 | - break; |
|
77 | - } |
|
78 | - return $validator->validate($email_address); |
|
79 | - } |
|
44 | + /** |
|
45 | + * Validates the email address. If it's invalid, an EmailValidationException |
|
46 | + * is thrown that describes why its invalid. |
|
47 | + * |
|
48 | + * @param string $email_address |
|
49 | + * @return boolean |
|
50 | + * @throws EmailValidationException |
|
51 | + */ |
|
52 | + public function validate($email_address) |
|
53 | + { |
|
54 | + // pick the correct validator according to the config |
|
55 | + switch ($this->registration_config->email_validation_level) { |
|
56 | + case 'basic': |
|
57 | + $validator = $this->loader->getShared( |
|
58 | + 'EventEspresso\core\domain\services\validation\email\strategies\Basic' |
|
59 | + ); |
|
60 | + break; |
|
61 | + case 'i18n': |
|
62 | + $validator = $this->loader->getShared( |
|
63 | + 'EventEspresso\core\domain\services\validation\email\strategies\International' |
|
64 | + ); |
|
65 | + break; |
|
66 | + case 'i18n_dns': |
|
67 | + $validator = $this->loader->getShared( |
|
68 | + 'EventEspresso\core\domain\services\validation\email\strategies\InternationalDNS' |
|
69 | + ); |
|
70 | + break; |
|
71 | + case 'wp_default': |
|
72 | + default: |
|
73 | + $validator = $this->loader->getShared( |
|
74 | + 'EventEspresso\core\domain\services\validation\email\strategies\WordPress' |
|
75 | + ); |
|
76 | + break; |
|
77 | + } |
|
78 | + return $validator->validate($email_address); |
|
79 | + } |
|
80 | 80 | } |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $ee_rest_url_prefix = RecommendedVersions::compareWordPressVersion('4.4.0') |
97 | 97 | ? trim(rest_get_url_prefix(), '/') |
98 | 98 | : 'wp-json'; |
99 | - $ee_rest_url_prefix .= '/' . Domain::API_NAMESPACE; |
|
99 | + $ee_rest_url_prefix .= '/'.Domain::API_NAMESPACE; |
|
100 | 100 | return $this->uriPathMatches($ee_rest_url_prefix); |
101 | 101 | } |
102 | 102 |
@@ -19,137 +19,137 @@ |
||
19 | 19 | class RequestTypeContextDetector |
20 | 20 | { |
21 | 21 | |
22 | - /** |
|
23 | - * @var RequestTypeContextFactory $factory |
|
24 | - */ |
|
25 | - private $factory; |
|
26 | - |
|
27 | - /** |
|
28 | - * @var RequestInterface $request |
|
29 | - */ |
|
30 | - private $request; |
|
31 | - |
|
32 | - |
|
33 | - /** |
|
34 | - * RequestTypeContextDetector constructor. |
|
35 | - * |
|
36 | - * @param RequestInterface $request |
|
37 | - * @param RequestTypeContextFactory $factory |
|
38 | - */ |
|
39 | - public function __construct(RequestInterface $request, RequestTypeContextFactory $factory) |
|
40 | - { |
|
41 | - $this->request = $request; |
|
42 | - $this->factory = $factory; |
|
43 | - } |
|
44 | - |
|
45 | - |
|
46 | - /** |
|
47 | - * @return RequestTypeContext |
|
48 | - * @throws InvalidArgumentException |
|
49 | - */ |
|
50 | - public function detectRequestTypeContext() |
|
51 | - { |
|
52 | - // Detect error scrapes |
|
53 | - if ($this->request->getRequestParam('wp_scrape_key') !== null |
|
54 | - && $this->request->getRequestParam('wp_scrape_nonce') !== null |
|
55 | - ) { |
|
56 | - return $this->factory->create(RequestTypeContext::WP_SCRAPE); |
|
57 | - } |
|
58 | - // Detect EE REST API |
|
59 | - if ($this->isEspressoRestApiRequest()) { |
|
60 | - return $this->factory->create(RequestTypeContext::API); |
|
61 | - } |
|
62 | - // Detect AJAX |
|
63 | - if (defined('DOING_AJAX') && DOING_AJAX) { |
|
64 | - if (filter_var($this->request->getRequestParam('ee_front_ajax'), FILTER_VALIDATE_BOOLEAN)) { |
|
65 | - return $this->factory->create(RequestTypeContext::AJAX_FRONT); |
|
66 | - } |
|
67 | - if (filter_var($this->request->getRequestParam('ee_admin_ajax'), FILTER_VALIDATE_BOOLEAN)) { |
|
68 | - return $this->factory->create(RequestTypeContext::AJAX_ADMIN); |
|
69 | - } |
|
70 | - return $this->factory->create(RequestTypeContext::AJAX_OTHER); |
|
71 | - } |
|
72 | - // Detect WP_Cron |
|
73 | - if ($this->isCronRequest()) { |
|
74 | - return $this->factory->create(RequestTypeContext::CRON); |
|
75 | - } |
|
76 | - // Detect command line requests |
|
77 | - if (defined('WP_CLI') && WP_CLI) { |
|
78 | - return $this->factory->create(RequestTypeContext::CLI); |
|
79 | - } |
|
80 | - // detect WordPress admin (ie: "Dashboard") |
|
81 | - if (is_admin()) { |
|
82 | - return $this->factory->create(RequestTypeContext::ADMIN); |
|
83 | - } |
|
84 | - // Detect iFrames |
|
85 | - if ($this->isIframeRoute()) { |
|
86 | - return $this->factory->create(RequestTypeContext::IFRAME); |
|
87 | - } |
|
88 | - // Detect Feeds |
|
89 | - if ($this->isFeedRequest()) { |
|
90 | - return $this->factory->create(RequestTypeContext::FEED); |
|
91 | - } |
|
92 | - // and by process of elimination... |
|
93 | - return $this->factory->create(RequestTypeContext::FRONTEND); |
|
94 | - } |
|
95 | - |
|
96 | - |
|
97 | - /** |
|
98 | - * @return bool |
|
99 | - */ |
|
100 | - private function isEspressoRestApiRequest() |
|
101 | - { |
|
102 | - $ee_rest_url_prefix = RecommendedVersions::compareWordPressVersion('4.4.0') |
|
103 | - ? trim(rest_get_url_prefix(), '/') |
|
104 | - : 'wp-json'; |
|
105 | - $ee_rest_url_prefix .= '/' . Domain::API_NAMESPACE; |
|
106 | - return $this->uriPathMatches($ee_rest_url_prefix); |
|
107 | - } |
|
108 | - |
|
109 | - |
|
110 | - /** |
|
111 | - * @return bool |
|
112 | - */ |
|
113 | - private function isCronRequest() |
|
114 | - { |
|
115 | - return $this->uriPathMatches('wp-cron.php'); |
|
116 | - } |
|
117 | - |
|
118 | - |
|
119 | - /** |
|
120 | - * @return bool |
|
121 | - */ |
|
122 | - private function isFeedRequest() |
|
123 | - { |
|
124 | - return $this->uriPathMatches('feed'); |
|
125 | - } |
|
126 | - |
|
127 | - |
|
128 | - /** |
|
129 | - * @param string $component |
|
130 | - * @return bool |
|
131 | - */ |
|
132 | - private function uriPathMatches($component) |
|
133 | - { |
|
134 | - $request_uri = $this->request->requestUri(); |
|
135 | - $parts = explode('?', $request_uri); |
|
136 | - $path = trim(reset($parts), '/'); |
|
137 | - return strpos($path, $component) === 0; |
|
138 | - } |
|
139 | - |
|
140 | - |
|
141 | - /** |
|
142 | - * @return bool |
|
143 | - */ |
|
144 | - private function isIframeRoute() |
|
145 | - { |
|
146 | - $is_iframe_route = apply_filters( |
|
147 | - 'FHEE__EventEspresso_core_domain_services_contexts_RequestTypeContextDetector__isIframeRoute', |
|
148 | - $this->request->getRequestParam('event_list', '') === 'iframe' |
|
149 | - || $this->request->getRequestParam('ticket_selector', '') === 'iframe' |
|
150 | - || $this->request->getRequestParam('calendar', '') === 'iframe', |
|
151 | - $this |
|
152 | - ); |
|
153 | - return filter_var($is_iframe_route, FILTER_VALIDATE_BOOLEAN); |
|
154 | - } |
|
22 | + /** |
|
23 | + * @var RequestTypeContextFactory $factory |
|
24 | + */ |
|
25 | + private $factory; |
|
26 | + |
|
27 | + /** |
|
28 | + * @var RequestInterface $request |
|
29 | + */ |
|
30 | + private $request; |
|
31 | + |
|
32 | + |
|
33 | + /** |
|
34 | + * RequestTypeContextDetector constructor. |
|
35 | + * |
|
36 | + * @param RequestInterface $request |
|
37 | + * @param RequestTypeContextFactory $factory |
|
38 | + */ |
|
39 | + public function __construct(RequestInterface $request, RequestTypeContextFactory $factory) |
|
40 | + { |
|
41 | + $this->request = $request; |
|
42 | + $this->factory = $factory; |
|
43 | + } |
|
44 | + |
|
45 | + |
|
46 | + /** |
|
47 | + * @return RequestTypeContext |
|
48 | + * @throws InvalidArgumentException |
|
49 | + */ |
|
50 | + public function detectRequestTypeContext() |
|
51 | + { |
|
52 | + // Detect error scrapes |
|
53 | + if ($this->request->getRequestParam('wp_scrape_key') !== null |
|
54 | + && $this->request->getRequestParam('wp_scrape_nonce') !== null |
|
55 | + ) { |
|
56 | + return $this->factory->create(RequestTypeContext::WP_SCRAPE); |
|
57 | + } |
|
58 | + // Detect EE REST API |
|
59 | + if ($this->isEspressoRestApiRequest()) { |
|
60 | + return $this->factory->create(RequestTypeContext::API); |
|
61 | + } |
|
62 | + // Detect AJAX |
|
63 | + if (defined('DOING_AJAX') && DOING_AJAX) { |
|
64 | + if (filter_var($this->request->getRequestParam('ee_front_ajax'), FILTER_VALIDATE_BOOLEAN)) { |
|
65 | + return $this->factory->create(RequestTypeContext::AJAX_FRONT); |
|
66 | + } |
|
67 | + if (filter_var($this->request->getRequestParam('ee_admin_ajax'), FILTER_VALIDATE_BOOLEAN)) { |
|
68 | + return $this->factory->create(RequestTypeContext::AJAX_ADMIN); |
|
69 | + } |
|
70 | + return $this->factory->create(RequestTypeContext::AJAX_OTHER); |
|
71 | + } |
|
72 | + // Detect WP_Cron |
|
73 | + if ($this->isCronRequest()) { |
|
74 | + return $this->factory->create(RequestTypeContext::CRON); |
|
75 | + } |
|
76 | + // Detect command line requests |
|
77 | + if (defined('WP_CLI') && WP_CLI) { |
|
78 | + return $this->factory->create(RequestTypeContext::CLI); |
|
79 | + } |
|
80 | + // detect WordPress admin (ie: "Dashboard") |
|
81 | + if (is_admin()) { |
|
82 | + return $this->factory->create(RequestTypeContext::ADMIN); |
|
83 | + } |
|
84 | + // Detect iFrames |
|
85 | + if ($this->isIframeRoute()) { |
|
86 | + return $this->factory->create(RequestTypeContext::IFRAME); |
|
87 | + } |
|
88 | + // Detect Feeds |
|
89 | + if ($this->isFeedRequest()) { |
|
90 | + return $this->factory->create(RequestTypeContext::FEED); |
|
91 | + } |
|
92 | + // and by process of elimination... |
|
93 | + return $this->factory->create(RequestTypeContext::FRONTEND); |
|
94 | + } |
|
95 | + |
|
96 | + |
|
97 | + /** |
|
98 | + * @return bool |
|
99 | + */ |
|
100 | + private function isEspressoRestApiRequest() |
|
101 | + { |
|
102 | + $ee_rest_url_prefix = RecommendedVersions::compareWordPressVersion('4.4.0') |
|
103 | + ? trim(rest_get_url_prefix(), '/') |
|
104 | + : 'wp-json'; |
|
105 | + $ee_rest_url_prefix .= '/' . Domain::API_NAMESPACE; |
|
106 | + return $this->uriPathMatches($ee_rest_url_prefix); |
|
107 | + } |
|
108 | + |
|
109 | + |
|
110 | + /** |
|
111 | + * @return bool |
|
112 | + */ |
|
113 | + private function isCronRequest() |
|
114 | + { |
|
115 | + return $this->uriPathMatches('wp-cron.php'); |
|
116 | + } |
|
117 | + |
|
118 | + |
|
119 | + /** |
|
120 | + * @return bool |
|
121 | + */ |
|
122 | + private function isFeedRequest() |
|
123 | + { |
|
124 | + return $this->uriPathMatches('feed'); |
|
125 | + } |
|
126 | + |
|
127 | + |
|
128 | + /** |
|
129 | + * @param string $component |
|
130 | + * @return bool |
|
131 | + */ |
|
132 | + private function uriPathMatches($component) |
|
133 | + { |
|
134 | + $request_uri = $this->request->requestUri(); |
|
135 | + $parts = explode('?', $request_uri); |
|
136 | + $path = trim(reset($parts), '/'); |
|
137 | + return strpos($path, $component) === 0; |
|
138 | + } |
|
139 | + |
|
140 | + |
|
141 | + /** |
|
142 | + * @return bool |
|
143 | + */ |
|
144 | + private function isIframeRoute() |
|
145 | + { |
|
146 | + $is_iframe_route = apply_filters( |
|
147 | + 'FHEE__EventEspresso_core_domain_services_contexts_RequestTypeContextDetector__isIframeRoute', |
|
148 | + $this->request->getRequestParam('event_list', '') === 'iframe' |
|
149 | + || $this->request->getRequestParam('ticket_selector', '') === 'iframe' |
|
150 | + || $this->request->getRequestParam('calendar', '') === 'iframe', |
|
151 | + $this |
|
152 | + ); |
|
153 | + return filter_var($is_iframe_route, FILTER_VALIDATE_BOOLEAN); |
|
154 | + } |
|
155 | 155 | } |
@@ -17,104 +17,104 @@ |
||
17 | 17 | class RequestTypeContextFactory |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * @var LoaderInterface $loader |
|
22 | - */ |
|
23 | - private $loader; |
|
20 | + /** |
|
21 | + * @var LoaderInterface $loader |
|
22 | + */ |
|
23 | + private $loader; |
|
24 | 24 | |
25 | 25 | |
26 | - /** |
|
27 | - * RequestTypeContextFactory constructor. |
|
28 | - * |
|
29 | - * @param LoaderInterface $loader |
|
30 | - */ |
|
31 | - public function __construct(LoaderInterface $loader) |
|
32 | - { |
|
33 | - $this->loader = $loader; |
|
34 | - } |
|
26 | + /** |
|
27 | + * RequestTypeContextFactory constructor. |
|
28 | + * |
|
29 | + * @param LoaderInterface $loader |
|
30 | + */ |
|
31 | + public function __construct(LoaderInterface $loader) |
|
32 | + { |
|
33 | + $this->loader = $loader; |
|
34 | + } |
|
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * @param string $slug |
|
39 | - * @return RequestTypeContext |
|
40 | - */ |
|
41 | - public function create($slug) |
|
42 | - { |
|
43 | - switch ($slug) { |
|
44 | - case RequestTypeContext::ACTIVATION: |
|
45 | - $description = esc_html__( |
|
46 | - 'The current request is for some form of activation', |
|
47 | - 'event_espresso' |
|
48 | - ); |
|
49 | - break; |
|
50 | - case RequestTypeContext::API: |
|
51 | - $description = esc_html__( |
|
52 | - 'The current request is for the REST API', |
|
53 | - 'event_espresso' |
|
54 | - ); |
|
55 | - break; |
|
56 | - case RequestTypeContext::AJAX_FRONT: |
|
57 | - $description = esc_html__( |
|
58 | - 'The current request is for the frontend via AJAX', |
|
59 | - 'event_espresso' |
|
60 | - ); |
|
61 | - break; |
|
62 | - case RequestTypeContext::AJAX_ADMIN: |
|
63 | - $description = esc_html__( |
|
64 | - 'The current request is for the admin via AJAX', |
|
65 | - 'event_espresso' |
|
66 | - ); |
|
67 | - break; |
|
68 | - case RequestTypeContext::AJAX_OTHER: |
|
69 | - $description = esc_html__( |
|
70 | - 'The current request is for non-EE related code via AJAX', |
|
71 | - 'event_espresso' |
|
72 | - ); |
|
73 | - break; |
|
74 | - case RequestTypeContext::CRON: |
|
75 | - $description = esc_html__( |
|
76 | - 'The current request is for a WP_Cron', |
|
77 | - 'event_espresso' |
|
78 | - ); |
|
79 | - break; |
|
80 | - case RequestTypeContext::CLI: |
|
81 | - $description = esc_html__( |
|
82 | - 'The current request is from the command line', |
|
83 | - 'event_espresso' |
|
84 | - ); |
|
85 | - break; |
|
86 | - case RequestTypeContext::ADMIN: |
|
87 | - $description = esc_html__( |
|
88 | - 'The current request is for the admin', |
|
89 | - 'event_espresso' |
|
90 | - ); |
|
91 | - break; |
|
92 | - case RequestTypeContext::IFRAME: |
|
93 | - $description = esc_html__( |
|
94 | - 'The current request is for an iframe', |
|
95 | - 'event_espresso' |
|
96 | - ); |
|
97 | - break; |
|
98 | - case RequestTypeContext::FEED: |
|
99 | - $description = esc_html__( |
|
100 | - 'The current request is for a feed (ie: RSS)', |
|
101 | - 'event_espresso' |
|
102 | - ); |
|
103 | - break; |
|
104 | - case RequestTypeContext::FRONTEND: |
|
105 | - default: |
|
106 | - $description = esc_html__( |
|
107 | - 'The current request is for the frontend', |
|
108 | - 'event_espresso' |
|
109 | - ); |
|
110 | - break; |
|
111 | - } |
|
112 | - // we're using the Loader with sharing turned on, |
|
113 | - // so that the generated RequestTypeContext object is accessible anywhere |
|
114 | - // by simply requesting it again from the loader |
|
115 | - return $this->loader->getShared( |
|
116 | - 'EventEspresso\core\domain\entities\contexts\RequestTypeContext', |
|
117 | - array($slug, $description) |
|
118 | - ); |
|
119 | - } |
|
37 | + /** |
|
38 | + * @param string $slug |
|
39 | + * @return RequestTypeContext |
|
40 | + */ |
|
41 | + public function create($slug) |
|
42 | + { |
|
43 | + switch ($slug) { |
|
44 | + case RequestTypeContext::ACTIVATION: |
|
45 | + $description = esc_html__( |
|
46 | + 'The current request is for some form of activation', |
|
47 | + 'event_espresso' |
|
48 | + ); |
|
49 | + break; |
|
50 | + case RequestTypeContext::API: |
|
51 | + $description = esc_html__( |
|
52 | + 'The current request is for the REST API', |
|
53 | + 'event_espresso' |
|
54 | + ); |
|
55 | + break; |
|
56 | + case RequestTypeContext::AJAX_FRONT: |
|
57 | + $description = esc_html__( |
|
58 | + 'The current request is for the frontend via AJAX', |
|
59 | + 'event_espresso' |
|
60 | + ); |
|
61 | + break; |
|
62 | + case RequestTypeContext::AJAX_ADMIN: |
|
63 | + $description = esc_html__( |
|
64 | + 'The current request is for the admin via AJAX', |
|
65 | + 'event_espresso' |
|
66 | + ); |
|
67 | + break; |
|
68 | + case RequestTypeContext::AJAX_OTHER: |
|
69 | + $description = esc_html__( |
|
70 | + 'The current request is for non-EE related code via AJAX', |
|
71 | + 'event_espresso' |
|
72 | + ); |
|
73 | + break; |
|
74 | + case RequestTypeContext::CRON: |
|
75 | + $description = esc_html__( |
|
76 | + 'The current request is for a WP_Cron', |
|
77 | + 'event_espresso' |
|
78 | + ); |
|
79 | + break; |
|
80 | + case RequestTypeContext::CLI: |
|
81 | + $description = esc_html__( |
|
82 | + 'The current request is from the command line', |
|
83 | + 'event_espresso' |
|
84 | + ); |
|
85 | + break; |
|
86 | + case RequestTypeContext::ADMIN: |
|
87 | + $description = esc_html__( |
|
88 | + 'The current request is for the admin', |
|
89 | + 'event_espresso' |
|
90 | + ); |
|
91 | + break; |
|
92 | + case RequestTypeContext::IFRAME: |
|
93 | + $description = esc_html__( |
|
94 | + 'The current request is for an iframe', |
|
95 | + 'event_espresso' |
|
96 | + ); |
|
97 | + break; |
|
98 | + case RequestTypeContext::FEED: |
|
99 | + $description = esc_html__( |
|
100 | + 'The current request is for a feed (ie: RSS)', |
|
101 | + 'event_espresso' |
|
102 | + ); |
|
103 | + break; |
|
104 | + case RequestTypeContext::FRONTEND: |
|
105 | + default: |
|
106 | + $description = esc_html__( |
|
107 | + 'The current request is for the frontend', |
|
108 | + 'event_espresso' |
|
109 | + ); |
|
110 | + break; |
|
111 | + } |
|
112 | + // we're using the Loader with sharing turned on, |
|
113 | + // so that the generated RequestTypeContext object is accessible anywhere |
|
114 | + // by simply requesting it again from the loader |
|
115 | + return $this->loader->getShared( |
|
116 | + 'EventEspresso\core\domain\entities\contexts\RequestTypeContext', |
|
117 | + array($slug, $description) |
|
118 | + ); |
|
119 | + } |
|
120 | 120 | } |
@@ -20,10 +20,10 @@ |
||
20 | 20 | abstract class DomainService implements DomainServiceInterface |
21 | 21 | { |
22 | 22 | |
23 | - /** |
|
24 | - * DomainService constructor. |
|
25 | - */ |
|
26 | - public function __construct() |
|
27 | - { |
|
28 | - } |
|
23 | + /** |
|
24 | + * DomainService constructor. |
|
25 | + */ |
|
26 | + public function __construct() |
|
27 | + { |
|
28 | + } |
|
29 | 29 | } |
@@ -13,30 +13,30 @@ |
||
13 | 13 | class RewriteRules |
14 | 14 | { |
15 | 15 | |
16 | - const OPTION_KEY_FLUSH_REWRITE_RULES = 'ee_flush_rewrite_rules'; |
|
16 | + const OPTION_KEY_FLUSH_REWRITE_RULES = 'ee_flush_rewrite_rules'; |
|
17 | 17 | |
18 | 18 | |
19 | - /** |
|
20 | - * This will flush rewrite rules on demand. This actually gets called around wp init priority level 100. |
|
21 | - * |
|
22 | - * @return void |
|
23 | - */ |
|
24 | - public function flush() |
|
25 | - { |
|
26 | - update_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, true); |
|
27 | - } |
|
19 | + /** |
|
20 | + * This will flush rewrite rules on demand. This actually gets called around wp init priority level 100. |
|
21 | + * |
|
22 | + * @return void |
|
23 | + */ |
|
24 | + public function flush() |
|
25 | + { |
|
26 | + update_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, true); |
|
27 | + } |
|
28 | 28 | |
29 | 29 | |
30 | - /** |
|
31 | - * This will flush rewrite rules on demand. This actually gets called around wp init priority level 100. |
|
32 | - * |
|
33 | - * @return void |
|
34 | - */ |
|
35 | - public function flushRewriteRules() |
|
36 | - { |
|
37 | - if (get_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, true)) { |
|
38 | - flush_rewrite_rules(); |
|
39 | - update_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, false); |
|
40 | - } |
|
41 | - } |
|
30 | + /** |
|
31 | + * This will flush rewrite rules on demand. This actually gets called around wp init priority level 100. |
|
32 | + * |
|
33 | + * @return void |
|
34 | + */ |
|
35 | + public function flushRewriteRules() |
|
36 | + { |
|
37 | + if (get_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, true)) { |
|
38 | + flush_rewrite_rules(); |
|
39 | + update_option(RewriteRules::OPTION_KEY_FLUSH_REWRITE_RULES, false); |
|
40 | + } |
|
41 | + } |
|
42 | 42 | } |
@@ -16,25 +16,25 @@ |
||
16 | 16 | interface CapabilitiesCheckerInterface |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * Verifies that the current user has ALL of the capabilities listed in the CapCheck DTO. |
|
21 | - * If any of the individual capability checks fails, then the command will NOT be executed. |
|
22 | - * |
|
23 | - * @param CapCheckInterface|CapCheckInterface[] $cap_check |
|
24 | - * @return bool |
|
25 | - * @throws InvalidClassException |
|
26 | - * @throws InsufficientPermissionsException |
|
27 | - */ |
|
28 | - public function processCapCheck($cap_check); |
|
19 | + /** |
|
20 | + * Verifies that the current user has ALL of the capabilities listed in the CapCheck DTO. |
|
21 | + * If any of the individual capability checks fails, then the command will NOT be executed. |
|
22 | + * |
|
23 | + * @param CapCheckInterface|CapCheckInterface[] $cap_check |
|
24 | + * @return bool |
|
25 | + * @throws InvalidClassException |
|
26 | + * @throws InsufficientPermissionsException |
|
27 | + */ |
|
28 | + public function processCapCheck($cap_check); |
|
29 | 29 | |
30 | 30 | |
31 | - /** |
|
32 | - * @param string $capability - the capability to be checked, like: 'ee_edit_registrations' |
|
33 | - * @param string $context - what the user is attempting to do, like: 'Edit Registration' |
|
34 | - * @param int $ID - (optional) ID for item where current_user_can is being called from |
|
35 | - * @return bool |
|
36 | - * @throws InsufficientPermissionsException |
|
37 | - * @throws InvalidClassException |
|
38 | - */ |
|
39 | - public function process($capability, $context, $ID = 0); |
|
31 | + /** |
|
32 | + * @param string $capability - the capability to be checked, like: 'ee_edit_registrations' |
|
33 | + * @param string $context - what the user is attempting to do, like: 'Edit Registration' |
|
34 | + * @param int $ID - (optional) ID for item where current_user_can is being called from |
|
35 | + * @return bool |
|
36 | + * @throws InsufficientPermissionsException |
|
37 | + * @throws InvalidClassException |
|
38 | + */ |
|
39 | + public function process($capability, $context, $ID = 0); |
|
40 | 40 | } |