@@ -4,63 +4,63 @@ |
||
4 | 4 | |
5 | 5 | interface HasSchemaInterface |
6 | 6 | { |
7 | - /** |
|
8 | - * Returns whatever is set as the nicename for the object. |
|
9 | - * |
|
10 | - * @return string |
|
11 | - */ |
|
12 | - public function getSchemaDescription(); |
|
7 | + /** |
|
8 | + * Returns whatever is set as the nicename for the object. |
|
9 | + * |
|
10 | + * @return string |
|
11 | + */ |
|
12 | + public function getSchemaDescription(); |
|
13 | 13 | |
14 | 14 | |
15 | - /** |
|
16 | - * Returns whatever is set as the $_schema_type property for the object. |
|
17 | - * Note: this will automatically add 'null' to the schema if the object is_nullable() |
|
18 | - * |
|
19 | - * @return string|array |
|
20 | - */ |
|
21 | - public function getSchemaType(); |
|
15 | + /** |
|
16 | + * Returns whatever is set as the $_schema_type property for the object. |
|
17 | + * Note: this will automatically add 'null' to the schema if the object is_nullable() |
|
18 | + * |
|
19 | + * @return string|array |
|
20 | + */ |
|
21 | + public function getSchemaType(); |
|
22 | 22 | |
23 | 23 | |
24 | - /** |
|
25 | - * This is usually present when the $_schema_type property is 'object'. Any child classes will need to override |
|
26 | - * this method and return the properties for the schema. |
|
27 | - * The reason this is not a property on the class is because there may be filters set on the values for the property |
|
28 | - * that won't be exposed on construct. For example enum type schemas may have the enum values filtered. |
|
29 | - * |
|
30 | - * @return array |
|
31 | - */ |
|
32 | - public function getSchemaProperties(); |
|
24 | + /** |
|
25 | + * This is usually present when the $_schema_type property is 'object'. Any child classes will need to override |
|
26 | + * this method and return the properties for the schema. |
|
27 | + * The reason this is not a property on the class is because there may be filters set on the values for the property |
|
28 | + * that won't be exposed on construct. For example enum type schemas may have the enum values filtered. |
|
29 | + * |
|
30 | + * @return array |
|
31 | + */ |
|
32 | + public function getSchemaProperties(); |
|
33 | 33 | |
34 | - /** |
|
35 | - * If a child class has enum values, they should override this method and provide a simple array |
|
36 | - * of the enum values. |
|
37 | - * The reason this is not a property on the class is because there may be filterable enum values that |
|
38 | - * are set on the instantiated object that could be filtered after construct. |
|
39 | - * |
|
40 | - * @return array |
|
41 | - */ |
|
42 | - public function getSchemaEnum(); |
|
34 | + /** |
|
35 | + * If a child class has enum values, they should override this method and provide a simple array |
|
36 | + * of the enum values. |
|
37 | + * The reason this is not a property on the class is because there may be filterable enum values that |
|
38 | + * are set on the instantiated object that could be filtered after construct. |
|
39 | + * |
|
40 | + * @return array |
|
41 | + */ |
|
42 | + public function getSchemaEnum(); |
|
43 | 43 | |
44 | - /** |
|
45 | - * This returns the value of the $_schema_format property on the object. |
|
46 | - * |
|
47 | - * @return string |
|
48 | - */ |
|
49 | - public function getSchemaFormat(); |
|
44 | + /** |
|
45 | + * This returns the value of the $_schema_format property on the object. |
|
46 | + * |
|
47 | + * @return string |
|
48 | + */ |
|
49 | + public function getSchemaFormat(); |
|
50 | 50 | |
51 | - /** |
|
52 | - * This returns the value of the $_schema_readonly property on the object. |
|
53 | - * |
|
54 | - * @return bool |
|
55 | - */ |
|
56 | - public function getSchemaReadonly(); |
|
51 | + /** |
|
52 | + * This returns the value of the $_schema_readonly property on the object. |
|
53 | + * |
|
54 | + * @return bool |
|
55 | + */ |
|
56 | + public function getSchemaReadonly(); |
|
57 | 57 | |
58 | 58 | |
59 | - /** |
|
60 | - * This returns elements used to represent this field in the json schema. |
|
61 | - * |
|
62 | - * @link http://json-schema.org/ |
|
63 | - * @return array |
|
64 | - */ |
|
65 | - public function getSchema(); |
|
59 | + /** |
|
60 | + * This returns elements used to represent this field in the json schema. |
|
61 | + * |
|
62 | + * @link http://json-schema.org/ |
|
63 | + * @return array |
|
64 | + */ |
|
65 | + public function getSchema(); |
|
66 | 66 | } |
@@ -12,9 +12,9 @@ |
||
12 | 12 | */ |
13 | 13 | interface CaffeinatedInterface |
14 | 14 | { |
15 | - /** |
|
16 | - * Used to indicate when functionality is caffeinated or not. |
|
17 | - * @return bool |
|
18 | - */ |
|
19 | - public function isCaffeinated(); |
|
15 | + /** |
|
16 | + * Used to indicate when functionality is caffeinated or not. |
|
17 | + * @return bool |
|
18 | + */ |
|
19 | + public function isCaffeinated(); |
|
20 | 20 | } |
@@ -5,8 +5,8 @@ |
||
5 | 5 | interface SessionIdentifierInterface |
6 | 6 | { |
7 | 7 | |
8 | - /** |
|
9 | - * @return string |
|
10 | - */ |
|
11 | - public function id(); |
|
8 | + /** |
|
9 | + * @return string |
|
10 | + */ |
|
11 | + public function id(); |
|
12 | 12 | } |
@@ -16,45 +16,45 @@ |
||
16 | 16 | class CancelRegistrationService |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * @var CancelTicketLineItemService $cancel_ticket_line_item_service |
|
21 | - */ |
|
22 | - private $cancel_ticket_line_item_service; |
|
23 | - |
|
24 | - |
|
25 | - /** |
|
26 | - * Command constructor |
|
27 | - * |
|
28 | - * @param CancelTicketLineItemService $cancel_ticket_line_item_service |
|
29 | - */ |
|
30 | - public function __construct(CancelTicketLineItemService $cancel_ticket_line_item_service) |
|
31 | - { |
|
32 | - $this->cancel_ticket_line_item_service = $cancel_ticket_line_item_service; |
|
33 | - } |
|
34 | - |
|
35 | - |
|
36 | - /** |
|
37 | - * @param \EE_Registration $registration |
|
38 | - * @param bool $cancel_ticket_line_item |
|
39 | - */ |
|
40 | - public function cancelRegistrationAndTicketLineItem(\EE_Registration $registration, $cancel_ticket_line_item = true) |
|
41 | - { |
|
42 | - // first cancel the original line item for the registration's ticket |
|
43 | - if ($cancel_ticket_line_item) { |
|
44 | - $this->cancel_ticket_line_item_service->forRegistration($registration); |
|
45 | - } |
|
46 | - $this->cancelRegistrationOnly($registration); |
|
47 | - } |
|
48 | - |
|
49 | - |
|
50 | - /** |
|
51 | - * @param \EE_Registration $registration |
|
52 | - * @throws \EE_Error |
|
53 | - */ |
|
54 | - public function cancelRegistrationOnly(\EE_Registration $registration) |
|
55 | - { |
|
56 | - // now cancel the registration itself |
|
57 | - $registration->set_status(\EEM_Registration::status_id_cancelled); |
|
58 | - $registration->save(); |
|
59 | - } |
|
19 | + /** |
|
20 | + * @var CancelTicketLineItemService $cancel_ticket_line_item_service |
|
21 | + */ |
|
22 | + private $cancel_ticket_line_item_service; |
|
23 | + |
|
24 | + |
|
25 | + /** |
|
26 | + * Command constructor |
|
27 | + * |
|
28 | + * @param CancelTicketLineItemService $cancel_ticket_line_item_service |
|
29 | + */ |
|
30 | + public function __construct(CancelTicketLineItemService $cancel_ticket_line_item_service) |
|
31 | + { |
|
32 | + $this->cancel_ticket_line_item_service = $cancel_ticket_line_item_service; |
|
33 | + } |
|
34 | + |
|
35 | + |
|
36 | + /** |
|
37 | + * @param \EE_Registration $registration |
|
38 | + * @param bool $cancel_ticket_line_item |
|
39 | + */ |
|
40 | + public function cancelRegistrationAndTicketLineItem(\EE_Registration $registration, $cancel_ticket_line_item = true) |
|
41 | + { |
|
42 | + // first cancel the original line item for the registration's ticket |
|
43 | + if ($cancel_ticket_line_item) { |
|
44 | + $this->cancel_ticket_line_item_service->forRegistration($registration); |
|
45 | + } |
|
46 | + $this->cancelRegistrationOnly($registration); |
|
47 | + } |
|
48 | + |
|
49 | + |
|
50 | + /** |
|
51 | + * @param \EE_Registration $registration |
|
52 | + * @throws \EE_Error |
|
53 | + */ |
|
54 | + public function cancelRegistrationOnly(\EE_Registration $registration) |
|
55 | + { |
|
56 | + // now cancel the registration itself |
|
57 | + $registration->set_status(\EEM_Registration::status_id_cancelled); |
|
58 | + $registration->save(); |
|
59 | + } |
|
60 | 60 | } |
@@ -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 | ); |
@@ -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 | } |
@@ -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 | } |
@@ -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 | } |