@@ -13,5 +13,5 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | abstract class JobHandler implements JobHandlerInterface |
| 15 | 15 | { |
| 16 | - // so far no common methods or properties |
|
| 16 | + // so far no common methods or properties |
|
| 17 | 17 | } |
@@ -14,5 +14,5 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class BatchRequestException extends \Exception |
| 16 | 16 | { |
| 17 | - // so far the same as exception |
|
| 17 | + // so far the same as exception |
|
| 18 | 18 | } |
@@ -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 | } |
@@ -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 | ); |
@@ -14,19 +14,19 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class WordPress extends Basic |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * @param string $email_address |
|
| 19 | - * @return boolean |
|
| 20 | - * @throws EmailValidationException |
|
| 21 | - */ |
|
| 22 | - public function validate($email_address) |
|
| 23 | - { |
|
| 24 | - parent::validate($email_address); |
|
| 25 | - if (! is_email($email_address)) { |
|
| 26 | - throw new EmailValidationException( |
|
| 27 | - esc_html__('The email address provided is not valid.', 'event_espresso') |
|
| 28 | - ); |
|
| 29 | - } |
|
| 30 | - return true; |
|
| 31 | - } |
|
| 17 | + /** |
|
| 18 | + * @param string $email_address |
|
| 19 | + * @return boolean |
|
| 20 | + * @throws EmailValidationException |
|
| 21 | + */ |
|
| 22 | + public function validate($email_address) |
|
| 23 | + { |
|
| 24 | + parent::validate($email_address); |
|
| 25 | + if (! is_email($email_address)) { |
|
| 26 | + throw new EmailValidationException( |
|
| 27 | + esc_html__('The email address provided is not valid.', 'event_espresso') |
|
| 28 | + ); |
|
| 29 | + } |
|
| 30 | + return true; |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -40,10 +40,10 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public function __construct($capability, $context, $ID = 0) |
| 42 | 42 | { |
| 43 | - if (! (is_string($capability) || is_array($capability))) { |
|
| 43 | + if ( ! (is_string($capability) || is_array($capability))) { |
|
| 44 | 44 | throw new InvalidDataTypeException('$capability', $capability, 'string or array'); |
| 45 | 45 | } |
| 46 | - if (! is_string($context)) { |
|
| 46 | + if ( ! is_string($context)) { |
|
| 47 | 47 | throw new InvalidDataTypeException('$context', $context, 'string'); |
| 48 | 48 | } |
| 49 | 49 | $this->capability = $capability; |
@@ -14,66 +14,66 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class CapCheck implements CapCheckInterface |
| 16 | 16 | { |
| 17 | - /** |
|
| 18 | - * @var string|array $capability |
|
| 19 | - */ |
|
| 20 | - private $capability; |
|
| 17 | + /** |
|
| 18 | + * @var string|array $capability |
|
| 19 | + */ |
|
| 20 | + private $capability; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @var string $context |
|
| 24 | - */ |
|
| 25 | - private $context; |
|
| 22 | + /** |
|
| 23 | + * @var string $context |
|
| 24 | + */ |
|
| 25 | + private $context; |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * @var int|string $ID |
|
| 29 | - */ |
|
| 30 | - private $ID; |
|
| 27 | + /** |
|
| 28 | + * @var int|string $ID |
|
| 29 | + */ |
|
| 30 | + private $ID; |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @param string|array $capability - the capability to be checked, like: 'ee_edit_registrations', |
|
| 35 | - * or an array of capability strings |
|
| 36 | - * @param string $context - what the user is attempting to do, like: 'Edit Registration' |
|
| 37 | - * @param int $ID - (optional) ID for item where current_user_can is being called from |
|
| 38 | - * @throws InvalidDataTypeException |
|
| 39 | - */ |
|
| 40 | - public function __construct($capability, $context, $ID = 0) |
|
| 41 | - { |
|
| 42 | - if (! (is_string($capability) || is_array($capability))) { |
|
| 43 | - throw new InvalidDataTypeException('$capability', $capability, 'string or array'); |
|
| 44 | - } |
|
| 45 | - if (! is_string($context)) { |
|
| 46 | - throw new InvalidDataTypeException('$context', $context, 'string'); |
|
| 47 | - } |
|
| 48 | - $this->capability = $capability; |
|
| 49 | - $this->context = strtolower(str_replace(' ', '_', $context)); |
|
| 50 | - $this->ID = $ID; |
|
| 51 | - } |
|
| 33 | + /** |
|
| 34 | + * @param string|array $capability - the capability to be checked, like: 'ee_edit_registrations', |
|
| 35 | + * or an array of capability strings |
|
| 36 | + * @param string $context - what the user is attempting to do, like: 'Edit Registration' |
|
| 37 | + * @param int $ID - (optional) ID for item where current_user_can is being called from |
|
| 38 | + * @throws InvalidDataTypeException |
|
| 39 | + */ |
|
| 40 | + public function __construct($capability, $context, $ID = 0) |
|
| 41 | + { |
|
| 42 | + if (! (is_string($capability) || is_array($capability))) { |
|
| 43 | + throw new InvalidDataTypeException('$capability', $capability, 'string or array'); |
|
| 44 | + } |
|
| 45 | + if (! is_string($context)) { |
|
| 46 | + throw new InvalidDataTypeException('$context', $context, 'string'); |
|
| 47 | + } |
|
| 48 | + $this->capability = $capability; |
|
| 49 | + $this->context = strtolower(str_replace(' ', '_', $context)); |
|
| 50 | + $this->ID = $ID; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * @return string|array |
|
| 56 | - */ |
|
| 57 | - public function capability() |
|
| 58 | - { |
|
| 59 | - return $this->capability; |
|
| 60 | - } |
|
| 54 | + /** |
|
| 55 | + * @return string|array |
|
| 56 | + */ |
|
| 57 | + public function capability() |
|
| 58 | + { |
|
| 59 | + return $this->capability; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * @return string |
|
| 65 | - */ |
|
| 66 | - public function context() |
|
| 67 | - { |
|
| 68 | - return $this->context; |
|
| 69 | - } |
|
| 63 | + /** |
|
| 64 | + * @return string |
|
| 65 | + */ |
|
| 66 | + public function context() |
|
| 67 | + { |
|
| 68 | + return $this->context; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * @return int|string |
|
| 74 | - */ |
|
| 75 | - public function ID() |
|
| 76 | - { |
|
| 77 | - return $this->ID; |
|
| 78 | - } |
|
| 72 | + /** |
|
| 73 | + * @return int|string |
|
| 74 | + */ |
|
| 75 | + public function ID() |
|
| 76 | + { |
|
| 77 | + return $this->ID; |
|
| 78 | + } |
|
| 79 | 79 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $quantity = 1 |
| 31 | 31 | ) { |
| 32 | 32 | $total_line_item = $transaction->total_line_item(); |
| 33 | - if (! $total_line_item instanceof \EE_Line_Item) { |
|
| 33 | + if ( ! $total_line_item instanceof \EE_Line_Item) { |
|
| 34 | 34 | throw new UnexpectedEntityException($total_line_item, 'EE_Line_Item'); |
| 35 | 35 | } |
| 36 | 36 | // create new line item for ticket |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $ticket, |
| 40 | 40 | $quantity |
| 41 | 41 | ); |
| 42 | - if (! $ticket_line_item instanceof \EE_Line_Item) { |
|
| 42 | + if ( ! $ticket_line_item instanceof \EE_Line_Item) { |
|
| 43 | 43 | throw new UnexpectedEntityException($ticket_line_item, 'EE_Line_Item'); |
| 44 | 44 | } |
| 45 | 45 | $total_line_item->save_this_and_descendants_to_txn($transaction->ID()); |
@@ -15,41 +15,41 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class CreateTicketLineItemService extends DomainService |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * @param \EE_Transaction $transaction |
|
| 20 | - * @param \EE_Ticket $ticket |
|
| 21 | - * @param int $quantity |
|
| 22 | - * @return \EE_Line_Item |
|
| 23 | - * @throws \EE_Error |
|
| 24 | - * @throws UnexpectedEntityException |
|
| 25 | - */ |
|
| 26 | - public function create( |
|
| 27 | - \EE_Transaction $transaction, |
|
| 28 | - \EE_Ticket $ticket, |
|
| 29 | - $quantity = 1 |
|
| 30 | - ) { |
|
| 31 | - $total_line_item = $transaction->total_line_item(); |
|
| 32 | - if (! $total_line_item instanceof \EE_Line_Item) { |
|
| 33 | - throw new UnexpectedEntityException($total_line_item, 'EE_Line_Item'); |
|
| 34 | - } |
|
| 35 | - // create new line item for ticket |
|
| 36 | - $ticket_line_item = \EEH_Line_Item::add_ticket_purchase( |
|
| 37 | - $total_line_item, |
|
| 38 | - $ticket, |
|
| 39 | - $quantity |
|
| 40 | - ); |
|
| 41 | - if (! $ticket_line_item instanceof \EE_Line_Item) { |
|
| 42 | - throw new UnexpectedEntityException($ticket_line_item, 'EE_Line_Item'); |
|
| 43 | - } |
|
| 44 | - $total_line_item->save_this_and_descendants_to_txn($transaction->ID()); |
|
| 45 | - // apply any applicable promotions that were initially used during registration to new line items |
|
| 46 | - do_action( |
|
| 47 | - 'AHEE__\EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler__handle__new_ticket_line_item_added', |
|
| 48 | - $total_line_item, |
|
| 49 | - $ticket, |
|
| 50 | - $transaction, |
|
| 51 | - $quantity |
|
| 52 | - ); |
|
| 53 | - return $ticket_line_item; |
|
| 54 | - } |
|
| 18 | + /** |
|
| 19 | + * @param \EE_Transaction $transaction |
|
| 20 | + * @param \EE_Ticket $ticket |
|
| 21 | + * @param int $quantity |
|
| 22 | + * @return \EE_Line_Item |
|
| 23 | + * @throws \EE_Error |
|
| 24 | + * @throws UnexpectedEntityException |
|
| 25 | + */ |
|
| 26 | + public function create( |
|
| 27 | + \EE_Transaction $transaction, |
|
| 28 | + \EE_Ticket $ticket, |
|
| 29 | + $quantity = 1 |
|
| 30 | + ) { |
|
| 31 | + $total_line_item = $transaction->total_line_item(); |
|
| 32 | + if (! $total_line_item instanceof \EE_Line_Item) { |
|
| 33 | + throw new UnexpectedEntityException($total_line_item, 'EE_Line_Item'); |
|
| 34 | + } |
|
| 35 | + // create new line item for ticket |
|
| 36 | + $ticket_line_item = \EEH_Line_Item::add_ticket_purchase( |
|
| 37 | + $total_line_item, |
|
| 38 | + $ticket, |
|
| 39 | + $quantity |
|
| 40 | + ); |
|
| 41 | + if (! $ticket_line_item instanceof \EE_Line_Item) { |
|
| 42 | + throw new UnexpectedEntityException($ticket_line_item, 'EE_Line_Item'); |
|
| 43 | + } |
|
| 44 | + $total_line_item->save_this_and_descendants_to_txn($transaction->ID()); |
|
| 45 | + // apply any applicable promotions that were initially used during registration to new line items |
|
| 46 | + do_action( |
|
| 47 | + 'AHEE__\EventEspresso\core\services\commands\ticket\CreateTicketLineItemCommandHandler__handle__new_ticket_line_item_added', |
|
| 48 | + $total_line_item, |
|
| 49 | + $ticket, |
|
| 50 | + $transaction, |
|
| 51 | + $quantity |
|
| 52 | + ); |
|
| 53 | + return $ticket_line_item; |
|
| 54 | + } |
|
| 55 | 55 | } |
@@ -4,31 +4,31 @@ |
||
| 4 | 4 | interface SetHooksInterface |
| 5 | 5 | { |
| 6 | 6 | |
| 7 | - /** |
|
| 8 | - * a place to add action and filter hooks for regular frontend requests |
|
| 9 | - * |
|
| 10 | - * @return void |
|
| 11 | - */ |
|
| 12 | - public function setHooks(); |
|
| 7 | + /** |
|
| 8 | + * a place to add action and filter hooks for regular frontend requests |
|
| 9 | + * |
|
| 10 | + * @return void |
|
| 11 | + */ |
|
| 12 | + public function setHooks(); |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * a place to add action and filter hooks for regular WP admin requests |
|
| 16 | - * |
|
| 17 | - * @return void |
|
| 18 | - */ |
|
| 19 | - public function setAdminHooks(); |
|
| 14 | + /** |
|
| 15 | + * a place to add action and filter hooks for regular WP admin requests |
|
| 16 | + * |
|
| 17 | + * @return void |
|
| 18 | + */ |
|
| 19 | + public function setAdminHooks(); |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * a place to add action and filter hooks for AJAX requests |
|
| 23 | - * |
|
| 24 | - * @return void |
|
| 25 | - */ |
|
| 26 | - public function setAjaxHooks(); |
|
| 21 | + /** |
|
| 22 | + * a place to add action and filter hooks for AJAX requests |
|
| 23 | + * |
|
| 24 | + * @return void |
|
| 25 | + */ |
|
| 26 | + public function setAjaxHooks(); |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * a place to add action and filter hooks for REST API requests |
|
| 30 | - * |
|
| 31 | - * @return void |
|
| 32 | - */ |
|
| 33 | - public function setApiHooks(); |
|
| 28 | + /** |
|
| 29 | + * a place to add action and filter hooks for REST API requests |
|
| 30 | + * |
|
| 31 | + * @return void |
|
| 32 | + */ |
|
| 33 | + public function setApiHooks(); |
|
| 34 | 34 | } |