@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * Collect the input_fields and sanitize them to prepare them for sending to the Query |
74 | 74 | */ |
75 | 75 | $input_fields = []; |
76 | - if (! empty($this->args['where'])) { |
|
76 | + if ( ! empty($this->args['where'])) { |
|
77 | 77 | $input_fields = $this->sanitizeInputFields($this->args['where']); |
78 | 78 | } |
79 | 79 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | /** |
99 | 99 | * Merge the input_fields with the default query_args |
100 | 100 | */ |
101 | - if (! empty($input_fields)) { |
|
101 | + if ( ! empty($input_fields)) { |
|
102 | 102 | $where_params = array_merge($where_params, $input_fields); |
103 | 103 | } |
104 | 104 |
@@ -16,130 +16,130 @@ |
||
16 | 16 | */ |
17 | 17 | class VenueConnectionResolver extends AbstractConnectionResolver |
18 | 18 | { |
19 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
20 | - public function get_loader_name(): string |
|
21 | - { |
|
22 | - return 'espresso_venue'; |
|
23 | - } |
|
24 | - |
|
25 | - /** |
|
26 | - * @return EEM_Venue |
|
27 | - * @throws EE_Error |
|
28 | - * @throws InvalidArgumentException |
|
29 | - * @throws InvalidDataTypeException |
|
30 | - * @throws InvalidInterfaceException |
|
31 | - * @throws ReflectionException |
|
32 | - */ |
|
33 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
34 | - public function get_query(): EEM_Venue |
|
35 | - { |
|
36 | - return EEM_Venue::instance(); |
|
37 | - } |
|
38 | - |
|
39 | - |
|
40 | - /** |
|
41 | - * Return an array of item IDs from the query |
|
42 | - * |
|
43 | - * @return array |
|
44 | - */ |
|
45 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
46 | - public function get_ids(): array |
|
47 | - { |
|
48 | - $results = $this->query->get_col($this->query_args); |
|
49 | - |
|
50 | - return ! empty($results) ? $results : []; |
|
51 | - } |
|
52 | - |
|
53 | - |
|
54 | - /** |
|
55 | - * Here, we map the args from the input, then we make sure that we're only querying |
|
56 | - * for IDs. The IDs are then passed down the resolve tree, and deferred resolvers |
|
57 | - * handle batch resolution of the posts. |
|
58 | - * |
|
59 | - * @return array |
|
60 | - */ |
|
61 | - // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
62 | - public function get_query_args(): array |
|
63 | - { |
|
64 | - $where_params = []; |
|
65 | - $query_args = []; |
|
66 | - |
|
67 | - $query_args['limit'] = $this->getLimit(); |
|
68 | - |
|
69 | - // Avoid multiple entries by join. |
|
70 | - $query_args['group_by'] = 'VNU_ID'; |
|
71 | - |
|
72 | - $query_args['default_where_conditions'] = 'minimum'; |
|
73 | - |
|
74 | - /** |
|
75 | - * Collect the input_fields and sanitize them to prepare them for sending to the Query |
|
76 | - */ |
|
77 | - $input_fields = []; |
|
78 | - if (! empty($this->args['where'])) { |
|
79 | - $input_fields = $this->sanitizeInputFields($this->args['where']); |
|
80 | - } |
|
81 | - |
|
82 | - /** |
|
83 | - * Determine where we're at in the Graph and adjust the query context appropriately. |
|
84 | - * For example, if we're querying for datetime as a field of event query, this will automatically |
|
85 | - * set the query to pull datetimes that belong to that event. |
|
86 | - * We can set more cases for other source types. |
|
87 | - */ |
|
88 | - if (is_object($this->source)) { |
|
89 | - switch (true) { |
|
90 | - // Assumed to be an event |
|
91 | - case $this->source instanceof Post: |
|
92 | - $where_params['Event.EVT_ID'] = $this->source->ID; |
|
93 | - break; |
|
94 | - case $this->source instanceof EE_Event: |
|
95 | - $where_params['Event.EVT_ID'] = $this->source->ID(); |
|
96 | - break; |
|
97 | - } |
|
98 | - } |
|
99 | - |
|
100 | - /** |
|
101 | - * Merge the input_fields with the default query_args |
|
102 | - */ |
|
103 | - if (! empty($input_fields)) { |
|
104 | - $where_params = array_merge($where_params, $input_fields); |
|
105 | - } |
|
106 | - |
|
107 | - [$query_args, $where_params] = $this->mapOrderbyInputArgs($query_args, $where_params, 'VNU_ID'); |
|
108 | - |
|
109 | - $where_params = apply_filters( |
|
110 | - 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__venue_where_params', |
|
111 | - $where_params, |
|
112 | - $this->source, |
|
113 | - $this->args |
|
114 | - ); |
|
115 | - |
|
116 | - $query_args[] = $where_params; |
|
117 | - |
|
118 | - /** |
|
119 | - * Return the $query_args |
|
120 | - */ |
|
121 | - return apply_filters( |
|
122 | - 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__venue_query_args', |
|
123 | - $query_args, |
|
124 | - $this->source, |
|
125 | - $this->args |
|
126 | - ); |
|
127 | - } |
|
128 | - |
|
129 | - |
|
130 | - /** |
|
131 | - * This sets up the "allowed" args, and translates the GraphQL-friendly keys to model |
|
132 | - * friendly keys. |
|
133 | - * |
|
134 | - * @param array $where_args |
|
135 | - * @return array |
|
136 | - */ |
|
137 | - public function sanitizeInputFields(array $where_args): array |
|
138 | - { |
|
139 | - return $this->sanitizeWhereArgsForInputFields( |
|
140 | - $where_args, |
|
141 | - [], |
|
142 | - [] |
|
143 | - ); |
|
144 | - } |
|
19 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
20 | + public function get_loader_name(): string |
|
21 | + { |
|
22 | + return 'espresso_venue'; |
|
23 | + } |
|
24 | + |
|
25 | + /** |
|
26 | + * @return EEM_Venue |
|
27 | + * @throws EE_Error |
|
28 | + * @throws InvalidArgumentException |
|
29 | + * @throws InvalidDataTypeException |
|
30 | + * @throws InvalidInterfaceException |
|
31 | + * @throws ReflectionException |
|
32 | + */ |
|
33 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
34 | + public function get_query(): EEM_Venue |
|
35 | + { |
|
36 | + return EEM_Venue::instance(); |
|
37 | + } |
|
38 | + |
|
39 | + |
|
40 | + /** |
|
41 | + * Return an array of item IDs from the query |
|
42 | + * |
|
43 | + * @return array |
|
44 | + */ |
|
45 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
46 | + public function get_ids(): array |
|
47 | + { |
|
48 | + $results = $this->query->get_col($this->query_args); |
|
49 | + |
|
50 | + return ! empty($results) ? $results : []; |
|
51 | + } |
|
52 | + |
|
53 | + |
|
54 | + /** |
|
55 | + * Here, we map the args from the input, then we make sure that we're only querying |
|
56 | + * for IDs. The IDs are then passed down the resolve tree, and deferred resolvers |
|
57 | + * handle batch resolution of the posts. |
|
58 | + * |
|
59 | + * @return array |
|
60 | + */ |
|
61 | + // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps |
|
62 | + public function get_query_args(): array |
|
63 | + { |
|
64 | + $where_params = []; |
|
65 | + $query_args = []; |
|
66 | + |
|
67 | + $query_args['limit'] = $this->getLimit(); |
|
68 | + |
|
69 | + // Avoid multiple entries by join. |
|
70 | + $query_args['group_by'] = 'VNU_ID'; |
|
71 | + |
|
72 | + $query_args['default_where_conditions'] = 'minimum'; |
|
73 | + |
|
74 | + /** |
|
75 | + * Collect the input_fields and sanitize them to prepare them for sending to the Query |
|
76 | + */ |
|
77 | + $input_fields = []; |
|
78 | + if (! empty($this->args['where'])) { |
|
79 | + $input_fields = $this->sanitizeInputFields($this->args['where']); |
|
80 | + } |
|
81 | + |
|
82 | + /** |
|
83 | + * Determine where we're at in the Graph and adjust the query context appropriately. |
|
84 | + * For example, if we're querying for datetime as a field of event query, this will automatically |
|
85 | + * set the query to pull datetimes that belong to that event. |
|
86 | + * We can set more cases for other source types. |
|
87 | + */ |
|
88 | + if (is_object($this->source)) { |
|
89 | + switch (true) { |
|
90 | + // Assumed to be an event |
|
91 | + case $this->source instanceof Post: |
|
92 | + $where_params['Event.EVT_ID'] = $this->source->ID; |
|
93 | + break; |
|
94 | + case $this->source instanceof EE_Event: |
|
95 | + $where_params['Event.EVT_ID'] = $this->source->ID(); |
|
96 | + break; |
|
97 | + } |
|
98 | + } |
|
99 | + |
|
100 | + /** |
|
101 | + * Merge the input_fields with the default query_args |
|
102 | + */ |
|
103 | + if (! empty($input_fields)) { |
|
104 | + $where_params = array_merge($where_params, $input_fields); |
|
105 | + } |
|
106 | + |
|
107 | + [$query_args, $where_params] = $this->mapOrderbyInputArgs($query_args, $where_params, 'VNU_ID'); |
|
108 | + |
|
109 | + $where_params = apply_filters( |
|
110 | + 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__venue_where_params', |
|
111 | + $where_params, |
|
112 | + $this->source, |
|
113 | + $this->args |
|
114 | + ); |
|
115 | + |
|
116 | + $query_args[] = $where_params; |
|
117 | + |
|
118 | + /** |
|
119 | + * Return the $query_args |
|
120 | + */ |
|
121 | + return apply_filters( |
|
122 | + 'FHEE__EventEspresso_core_domain_services_graphql_connection_resolvers__venue_query_args', |
|
123 | + $query_args, |
|
124 | + $this->source, |
|
125 | + $this->args |
|
126 | + ); |
|
127 | + } |
|
128 | + |
|
129 | + |
|
130 | + /** |
|
131 | + * This sets up the "allowed" args, and translates the GraphQL-friendly keys to model |
|
132 | + * friendly keys. |
|
133 | + * |
|
134 | + * @param array $where_args |
|
135 | + * @return array |
|
136 | + */ |
|
137 | + public function sanitizeInputFields(array $where_args): array |
|
138 | + { |
|
139 | + return $this->sanitizeWhereArgsForInputFields( |
|
140 | + $where_args, |
|
141 | + [], |
|
142 | + [] |
|
143 | + ); |
|
144 | + } |
|
145 | 145 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | public function initialize() |
37 | 37 | { |
38 | 38 | $current_user = wp_get_current_user(); |
39 | - if (! $current_user instanceof WP_User) { |
|
39 | + if ( ! $current_user instanceof WP_User) { |
|
40 | 40 | $current_user = new WP_User(); |
41 | 41 | } |
42 | 42 |
@@ -16,51 +16,51 @@ |
||
16 | 16 | */ |
17 | 17 | class CurrentUser extends JsonDataNode |
18 | 18 | { |
19 | - const NODE_NAME = 'currentUser'; |
|
19 | + const NODE_NAME = 'currentUser'; |
|
20 | 20 | |
21 | - /** |
|
22 | - * @var Capabilities $capabilities |
|
23 | - */ |
|
24 | - private $capabilities; |
|
21 | + /** |
|
22 | + * @var Capabilities $capabilities |
|
23 | + */ |
|
24 | + private $capabilities; |
|
25 | 25 | |
26 | - /** |
|
27 | - * @param Capabilities $capabilities |
|
28 | - * @param JsonDataNodeValidator $validator |
|
29 | - */ |
|
30 | - public function __construct(Capabilities $capabilities, JsonDataNodeValidator $validator) |
|
31 | - { |
|
32 | - parent::__construct($validator); |
|
33 | - $this->capabilities = $capabilities; |
|
34 | - $this->setNodeName(CurrentUser::NODE_NAME); |
|
35 | - } |
|
26 | + /** |
|
27 | + * @param Capabilities $capabilities |
|
28 | + * @param JsonDataNodeValidator $validator |
|
29 | + */ |
|
30 | + public function __construct(Capabilities $capabilities, JsonDataNodeValidator $validator) |
|
31 | + { |
|
32 | + parent::__construct($validator); |
|
33 | + $this->capabilities = $capabilities; |
|
34 | + $this->setNodeName(CurrentUser::NODE_NAME); |
|
35 | + } |
|
36 | 36 | |
37 | - /** |
|
38 | - * @inheritDoc |
|
39 | - */ |
|
40 | - public function initialize() |
|
41 | - { |
|
42 | - $current_user = wp_get_current_user(); |
|
43 | - if (! $current_user instanceof WP_User) { |
|
44 | - $current_user = new WP_User(); |
|
45 | - } |
|
37 | + /** |
|
38 | + * @inheritDoc |
|
39 | + */ |
|
40 | + public function initialize() |
|
41 | + { |
|
42 | + $current_user = wp_get_current_user(); |
|
43 | + if (! $current_user instanceof WP_User) { |
|
44 | + $current_user = new WP_User(); |
|
45 | + } |
|
46 | 46 | |
47 | - if (class_exists(Relay::class)) { |
|
48 | - $this->addData('id', Relay::toGlobalId('user', $current_user->ID)); |
|
49 | - } |
|
50 | - $this->addData('databaseId', $current_user->ID); |
|
51 | - $this->addData('description', $current_user->description); |
|
52 | - $this->addData('email', $current_user->user_email); |
|
53 | - $this->addData('firstName', $current_user->first_name); |
|
54 | - $this->addData('isa', is_super_admin($current_user->ID)); |
|
55 | - $this->addData('lastName', $current_user->last_name); |
|
56 | - $this->addData('locale', get_user_locale($current_user->ID)); |
|
57 | - $this->addData('name', $current_user->display_name); |
|
58 | - $this->addData('nicename', $current_user->user_nicename); |
|
59 | - $this->addData('nickname', $current_user->nickname); |
|
60 | - $this->addData('username', $current_user->user_login); |
|
61 | - $this->addData('roles', $current_user->roles); |
|
62 | - $this->addData('__typename', 'User'); |
|
63 | - $this->addDataNode($this->capabilities); |
|
64 | - $this->setInitialized(true); |
|
65 | - } |
|
47 | + if (class_exists(Relay::class)) { |
|
48 | + $this->addData('id', Relay::toGlobalId('user', $current_user->ID)); |
|
49 | + } |
|
50 | + $this->addData('databaseId', $current_user->ID); |
|
51 | + $this->addData('description', $current_user->description); |
|
52 | + $this->addData('email', $current_user->user_email); |
|
53 | + $this->addData('firstName', $current_user->first_name); |
|
54 | + $this->addData('isa', is_super_admin($current_user->ID)); |
|
55 | + $this->addData('lastName', $current_user->last_name); |
|
56 | + $this->addData('locale', get_user_locale($current_user->ID)); |
|
57 | + $this->addData('name', $current_user->display_name); |
|
58 | + $this->addData('nicename', $current_user->user_nicename); |
|
59 | + $this->addData('nickname', $current_user->nickname); |
|
60 | + $this->addData('username', $current_user->user_login); |
|
61 | + $this->addData('roles', $current_user->roles); |
|
62 | + $this->addData('__typename', 'User'); |
|
63 | + $this->addDataNode($this->capabilities); |
|
64 | + $this->setInitialized(true); |
|
65 | + } |
|
66 | 66 | } |
@@ -44,27 +44,27 @@ |
||
44 | 44 | $args['PRC_name'] = sanitize_text_field($input['name']); |
45 | 45 | } |
46 | 46 | |
47 | - if (! empty($input['order'])) { |
|
47 | + if ( ! empty($input['order'])) { |
|
48 | 48 | $args['PRC_order'] = (int) $input['order']; |
49 | 49 | } |
50 | 50 | |
51 | - if (! empty($input['overrides'])) { |
|
51 | + if ( ! empty($input['overrides'])) { |
|
52 | 52 | $args['PRC_overrides'] = (int) $input['overrides']; |
53 | 53 | } |
54 | 54 | |
55 | - if (! empty($input['parent'])) { |
|
55 | + if ( ! empty($input['parent'])) { |
|
56 | 56 | $parts = Relay::fromGlobalId(sanitize_text_field($input['parent'])); |
57 | 57 | $args['PRC_parent'] = ! empty($parts['id']) ? absint($parts['id']) : 0; |
58 | 58 | } |
59 | 59 | |
60 | - if (! empty($input['priceType'])) { |
|
60 | + if ( ! empty($input['priceType'])) { |
|
61 | 61 | $parts = Relay::fromGlobalId(sanitize_text_field($input['priceType'])); |
62 | 62 | $args['PRT_ID'] = ! empty($parts['id']) ? absint($parts['id']) : 0; |
63 | 63 | } |
64 | 64 | |
65 | - if (! empty($input['wpUser'])) { |
|
65 | + if ( ! empty($input['wpUser'])) { |
|
66 | 66 | $parts = Relay::fromGlobalId(sanitize_text_field($input['wpUser'])); |
67 | - $args['PRC_wp_user'] = (! empty($parts['id']) && is_int($parts['id'])) ? $parts['id'] : null; |
|
67 | + $args['PRC_wp_user'] = ( ! empty($parts['id']) && is_int($parts['id'])) ? $parts['id'] : null; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | return apply_filters( |
@@ -12,64 +12,64 @@ |
||
12 | 12 | */ |
13 | 13 | class PriceMutation |
14 | 14 | { |
15 | - /** |
|
16 | - * Maps the GraphQL input to a format that the model functions can use |
|
17 | - * |
|
18 | - * @param array $input Data coming from the GraphQL mutation query input |
|
19 | - * @return array |
|
20 | - */ |
|
21 | - public static function prepareFields(array $input): array |
|
22 | - { |
|
23 | - $args = []; |
|
15 | + /** |
|
16 | + * Maps the GraphQL input to a format that the model functions can use |
|
17 | + * |
|
18 | + * @param array $input Data coming from the GraphQL mutation query input |
|
19 | + * @return array |
|
20 | + */ |
|
21 | + public static function prepareFields(array $input): array |
|
22 | + { |
|
23 | + $args = []; |
|
24 | 24 | |
25 | - // amount can be 0 |
|
26 | - if (array_key_exists('amount', $input)) { |
|
27 | - $args['PRC_amount'] = (float) $input['amount']; |
|
28 | - } |
|
25 | + // amount can be 0 |
|
26 | + if (array_key_exists('amount', $input)) { |
|
27 | + $args['PRC_amount'] = (float) $input['amount']; |
|
28 | + } |
|
29 | 29 | |
30 | - if (isset($input['description'])) { |
|
31 | - $args['PRC_desc'] = wp_kses_post($input['description']); |
|
32 | - } |
|
30 | + if (isset($input['description'])) { |
|
31 | + $args['PRC_desc'] = wp_kses_post($input['description']); |
|
32 | + } |
|
33 | 33 | |
34 | - if (array_key_exists('isDefault', $input)) { |
|
35 | - $args['PRC_is_default'] = (bool) $input['isDefault']; |
|
36 | - } |
|
34 | + if (array_key_exists('isDefault', $input)) { |
|
35 | + $args['PRC_is_default'] = (bool) $input['isDefault']; |
|
36 | + } |
|
37 | 37 | |
38 | - if (array_key_exists('isTrashed', $input)) { |
|
39 | - $args['PRC_deleted'] = (bool) $input['isTrashed']; |
|
40 | - } |
|
38 | + if (array_key_exists('isTrashed', $input)) { |
|
39 | + $args['PRC_deleted'] = (bool) $input['isTrashed']; |
|
40 | + } |
|
41 | 41 | |
42 | - if (isset($input['name'])) { |
|
43 | - $args['PRC_name'] = sanitize_text_field($input['name']); |
|
44 | - } |
|
42 | + if (isset($input['name'])) { |
|
43 | + $args['PRC_name'] = sanitize_text_field($input['name']); |
|
44 | + } |
|
45 | 45 | |
46 | - if (! empty($input['order'])) { |
|
47 | - $args['PRC_order'] = (int) $input['order']; |
|
48 | - } |
|
46 | + if (! empty($input['order'])) { |
|
47 | + $args['PRC_order'] = (int) $input['order']; |
|
48 | + } |
|
49 | 49 | |
50 | - if (! empty($input['overrides'])) { |
|
51 | - $args['PRC_overrides'] = (int) $input['overrides']; |
|
52 | - } |
|
50 | + if (! empty($input['overrides'])) { |
|
51 | + $args['PRC_overrides'] = (int) $input['overrides']; |
|
52 | + } |
|
53 | 53 | |
54 | - if (! empty($input['parent'])) { |
|
55 | - $parts = Relay::fromGlobalId(sanitize_text_field($input['parent'])); |
|
56 | - $args['PRC_parent'] = ! empty($parts['id']) ? absint($parts['id']) : 0; |
|
57 | - } |
|
54 | + if (! empty($input['parent'])) { |
|
55 | + $parts = Relay::fromGlobalId(sanitize_text_field($input['parent'])); |
|
56 | + $args['PRC_parent'] = ! empty($parts['id']) ? absint($parts['id']) : 0; |
|
57 | + } |
|
58 | 58 | |
59 | - if (! empty($input['priceType'])) { |
|
60 | - $parts = Relay::fromGlobalId(sanitize_text_field($input['priceType'])); |
|
61 | - $args['PRT_ID'] = ! empty($parts['id']) ? absint($parts['id']) : 0; |
|
62 | - } |
|
59 | + if (! empty($input['priceType'])) { |
|
60 | + $parts = Relay::fromGlobalId(sanitize_text_field($input['priceType'])); |
|
61 | + $args['PRT_ID'] = ! empty($parts['id']) ? absint($parts['id']) : 0; |
|
62 | + } |
|
63 | 63 | |
64 | - if (! empty($input['wpUser'])) { |
|
65 | - $parts = Relay::fromGlobalId(sanitize_text_field($input['wpUser'])); |
|
66 | - $args['PRC_wp_user'] = (! empty($parts['id']) && is_int($parts['id'])) ? $parts['id'] : null; |
|
67 | - } |
|
64 | + if (! empty($input['wpUser'])) { |
|
65 | + $parts = Relay::fromGlobalId(sanitize_text_field($input['wpUser'])); |
|
66 | + $args['PRC_wp_user'] = (! empty($parts['id']) && is_int($parts['id'])) ? $parts['id'] : null; |
|
67 | + } |
|
68 | 68 | |
69 | - return apply_filters( |
|
70 | - 'FHEE__EventEspresso_core_domain_services_graphql_data_mutations__price_args', |
|
71 | - $args, |
|
72 | - $input |
|
73 | - ); |
|
74 | - } |
|
69 | + return apply_filters( |
|
70 | + 'FHEE__EventEspresso_core_domain_services_graphql_data_mutations__price_args', |
|
71 | + $args, |
|
72 | + $input |
|
73 | + ); |
|
74 | + } |
|
75 | 75 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | // $errors = []; |
42 | 42 | |
43 | 43 | try { |
44 | - if (empty($input['uniqueInputs']) || !is_array($input['uniqueInputs'])) { |
|
44 | + if (empty($input['uniqueInputs']) || ! is_array($input['uniqueInputs'])) { |
|
45 | 45 | throw new OutOfBoundsException( |
46 | 46 | esc_html__('A valid input was not provided.', 'event_espresso') |
47 | 47 | ); |
@@ -10,69 +10,69 @@ |
||
10 | 10 | class BulkEntityMutator extends EntityMutator |
11 | 11 | { |
12 | 12 | |
13 | - /** |
|
14 | - * @var callable $entity_mutator . |
|
15 | - */ |
|
16 | - protected $entity_mutator; |
|
13 | + /** |
|
14 | + * @var callable $entity_mutator . |
|
15 | + */ |
|
16 | + protected $entity_mutator; |
|
17 | 17 | |
18 | - /** |
|
19 | - * BulkEntityMutator constructor. |
|
20 | - * |
|
21 | - * @param callable $entity_mutator The mutator for an entity. |
|
22 | - */ |
|
23 | - public function __construct(callable $entity_mutator) |
|
24 | - { |
|
25 | - $this->entity_mutator = $entity_mutator; |
|
26 | - } |
|
27 | - /** |
|
28 | - * Bulk updates entities. |
|
29 | - * |
|
30 | - * @param array $input The input for the mutation |
|
31 | - * @param AppContext $context The AppContext passed down to all resolvers |
|
32 | - * @param ResolveInfo $info The ResolveInfo passed down to all resolvers |
|
33 | - * @return array |
|
34 | - */ |
|
35 | - public function updateEntities(array $input, AppContext $context, ResolveInfo $info): array |
|
36 | - { |
|
18 | + /** |
|
19 | + * BulkEntityMutator constructor. |
|
20 | + * |
|
21 | + * @param callable $entity_mutator The mutator for an entity. |
|
22 | + */ |
|
23 | + public function __construct(callable $entity_mutator) |
|
24 | + { |
|
25 | + $this->entity_mutator = $entity_mutator; |
|
26 | + } |
|
27 | + /** |
|
28 | + * Bulk updates entities. |
|
29 | + * |
|
30 | + * @param array $input The input for the mutation |
|
31 | + * @param AppContext $context The AppContext passed down to all resolvers |
|
32 | + * @param ResolveInfo $info The ResolveInfo passed down to all resolvers |
|
33 | + * @return array |
|
34 | + */ |
|
35 | + public function updateEntities(array $input, AppContext $context, ResolveInfo $info): array |
|
36 | + { |
|
37 | 37 | |
38 | - $updated = []; |
|
39 | - $failed = []; |
|
40 | - // TODO Add meaningful error messages for every failure. |
|
41 | - // $errors = []; |
|
38 | + $updated = []; |
|
39 | + $failed = []; |
|
40 | + // TODO Add meaningful error messages for every failure. |
|
41 | + // $errors = []; |
|
42 | 42 | |
43 | - try { |
|
44 | - if (empty($input['uniqueInputs']) || !is_array($input['uniqueInputs'])) { |
|
45 | - throw new OutOfBoundsException( |
|
46 | - esc_html__('A valid input was not provided.', 'event_espresso') |
|
47 | - ); |
|
48 | - } |
|
43 | + try { |
|
44 | + if (empty($input['uniqueInputs']) || !is_array($input['uniqueInputs'])) { |
|
45 | + throw new OutOfBoundsException( |
|
46 | + esc_html__('A valid input was not provided.', 'event_espresso') |
|
47 | + ); |
|
48 | + } |
|
49 | 49 | |
50 | - $sharedInput = ! empty($input['sharedInput']) ? $input['sharedInput'] : []; |
|
50 | + $sharedInput = ! empty($input['sharedInput']) ? $input['sharedInput'] : []; |
|
51 | 51 | |
52 | - foreach ($input['uniqueInputs'] as $uniqueInput) { |
|
53 | - try { |
|
54 | - // values in $uniqueInput will override those in $sharedInput |
|
55 | - $finalInput = array_merge($sharedInput, $uniqueInput); |
|
56 | - // mutate the individual entity. |
|
57 | - $mutator = $this->entity_mutator; |
|
58 | - $mutator($finalInput, $context, $info); |
|
59 | - // we are here it means the update was successful. |
|
60 | - $updated[] = $uniqueInput['id']; |
|
61 | - } catch (Exception $e) { |
|
62 | - // sorry mate, couldn't help you :( |
|
63 | - $failed[] = $uniqueInput['id']; |
|
64 | - } |
|
65 | - } |
|
66 | - } catch (Exception $exception) { |
|
67 | - EntityMutator::handleExceptions( |
|
68 | - $exception, |
|
69 | - esc_html__( |
|
70 | - 'Could not perform the update because of the following error(s)', |
|
71 | - 'event_espresso' |
|
72 | - ) |
|
73 | - ); |
|
74 | - } |
|
52 | + foreach ($input['uniqueInputs'] as $uniqueInput) { |
|
53 | + try { |
|
54 | + // values in $uniqueInput will override those in $sharedInput |
|
55 | + $finalInput = array_merge($sharedInput, $uniqueInput); |
|
56 | + // mutate the individual entity. |
|
57 | + $mutator = $this->entity_mutator; |
|
58 | + $mutator($finalInput, $context, $info); |
|
59 | + // we are here it means the update was successful. |
|
60 | + $updated[] = $uniqueInput['id']; |
|
61 | + } catch (Exception $e) { |
|
62 | + // sorry mate, couldn't help you :( |
|
63 | + $failed[] = $uniqueInput['id']; |
|
64 | + } |
|
65 | + } |
|
66 | + } catch (Exception $exception) { |
|
67 | + EntityMutator::handleExceptions( |
|
68 | + $exception, |
|
69 | + esc_html__( |
|
70 | + 'Could not perform the update because of the following error(s)', |
|
71 | + 'event_espresso' |
|
72 | + ) |
|
73 | + ); |
|
74 | + } |
|
75 | 75 | |
76 | - return compact('updated', 'failed'); |
|
77 | - } |
|
76 | + return compact('updated', 'failed'); |
|
77 | + } |
|
78 | 78 | } |
@@ -8,17 +8,17 @@ |
||
8 | 8 | class TicketBulkUpdate extends EntityMutator |
9 | 9 | { |
10 | 10 | |
11 | - /** |
|
12 | - * Defines the mutation data modification closure. |
|
13 | - * |
|
14 | - * @param EEM_Ticket $model |
|
15 | - * @param Ticket $type |
|
16 | - * @return callable |
|
17 | - */ |
|
18 | - public static function mutateAndGetPayload(EEM_Ticket $model, Ticket $type) |
|
19 | - { |
|
20 | - $entityMutator = TicketUpdate::mutateAndGetPayload($model, $type); |
|
21 | - $bulkMutator = new BulkEntityMutator($entityMutator); |
|
22 | - return array($bulkMutator, 'updateEntities'); |
|
23 | - } |
|
11 | + /** |
|
12 | + * Defines the mutation data modification closure. |
|
13 | + * |
|
14 | + * @param EEM_Ticket $model |
|
15 | + * @param Ticket $type |
|
16 | + * @return callable |
|
17 | + */ |
|
18 | + public static function mutateAndGetPayload(EEM_Ticket $model, Ticket $type) |
|
19 | + { |
|
20 | + $entityMutator = TicketUpdate::mutateAndGetPayload($model, $type); |
|
21 | + $bulkMutator = new BulkEntityMutator($entityMutator); |
|
22 | + return array($bulkMutator, 'updateEntities'); |
|
23 | + } |
|
24 | 24 | } |
@@ -4,97 +4,97 @@ |
||
4 | 4 | |
5 | 5 | class PhpToUnicode |
6 | 6 | { |
7 | - /** |
|
8 | - * array where keys are PHP date format parameters |
|
9 | - * and values are Unicode Date Format substitutions |
|
10 | - */ |
|
11 | - public static $date_formats = [ |
|
12 | - // YEAR |
|
13 | - 'y' => 'yy', // 00, 01, ..., 99 |
|
14 | - 'Y' => 'yyyy', // 2000, 2001, ..., 2099 |
|
15 | - 'o' => 'GGGG', // ISO "week-numbering year" 2000, 2001, ..., 2099 |
|
16 | - // MONTH |
|
17 | - 'M' => 'MMM', // Jan, Feb, ..., Dec |
|
18 | - 'n' => 'M', // 1, 2, ..., 12 |
|
19 | - 'm' => 'MM', // 01, 02, ..., 12 |
|
20 | - 'F' => 'MMMM', // January, February, ..., December |
|
21 | - // DAY |
|
22 | - 'd' => 'dd', // 01, 02, ..., 31 |
|
23 | - 'D' => 'eee', // Sun, Mon, ..., Sat |
|
24 | - 'jS' => 'do', // 1st, 2nd, ..., 31st |
|
25 | - 'j' => 'd', // 1, 2, ..., 31 |
|
26 | - 'l' => 'eeee', // Sunday, Monday, ..., Saturday |
|
27 | - 'N' => 'e', // Day of week 0, 1, ..., 6 |
|
28 | - 'w' => 'i', // ISO Day of week 1, 2, ..., 7 |
|
29 | - 'z' => 'D', // day of the year 0 - 365 to 1 - 366 |
|
30 | - // WEEK |
|
31 | - 'W' => 'w', |
|
32 | - ]; |
|
7 | + /** |
|
8 | + * array where keys are PHP date format parameters |
|
9 | + * and values are Unicode Date Format substitutions |
|
10 | + */ |
|
11 | + public static $date_formats = [ |
|
12 | + // YEAR |
|
13 | + 'y' => 'yy', // 00, 01, ..., 99 |
|
14 | + 'Y' => 'yyyy', // 2000, 2001, ..., 2099 |
|
15 | + 'o' => 'GGGG', // ISO "week-numbering year" 2000, 2001, ..., 2099 |
|
16 | + // MONTH |
|
17 | + 'M' => 'MMM', // Jan, Feb, ..., Dec |
|
18 | + 'n' => 'M', // 1, 2, ..., 12 |
|
19 | + 'm' => 'MM', // 01, 02, ..., 12 |
|
20 | + 'F' => 'MMMM', // January, February, ..., December |
|
21 | + // DAY |
|
22 | + 'd' => 'dd', // 01, 02, ..., 31 |
|
23 | + 'D' => 'eee', // Sun, Mon, ..., Sat |
|
24 | + 'jS' => 'do', // 1st, 2nd, ..., 31st |
|
25 | + 'j' => 'd', // 1, 2, ..., 31 |
|
26 | + 'l' => 'eeee', // Sunday, Monday, ..., Saturday |
|
27 | + 'N' => 'e', // Day of week 0, 1, ..., 6 |
|
28 | + 'w' => 'i', // ISO Day of week 1, 2, ..., 7 |
|
29 | + 'z' => 'D', // day of the year 0 - 365 to 1 - 366 |
|
30 | + // WEEK |
|
31 | + 'W' => 'w', |
|
32 | + ]; |
|
33 | 33 | |
34 | 34 | |
35 | - /** |
|
36 | - * array where keys are PHP time format parameters |
|
37 | - * and values are Unicode Time Format substitutions |
|
38 | - */ |
|
39 | - public static $time_formats = [ |
|
40 | - // 'a' => 'a', // am, pm, no pecific JS alternative |
|
41 | - 'A' => 'a', // AM, PM |
|
42 | - // HOUR |
|
43 | - // convert "g" to an intermediary format |
|
44 | - // to avoid its result getting replaced by "h" |
|
45 | - 'g' => '@', // 1, 2, ..., 12 |
|
46 | - 'h' => 'hh', // 01, 02, ..., 12 |
|
47 | - '@' => 'h', // 1, 2, ..., 12 |
|
48 | - 'G' => '#', // 0, 1, ... 23 |
|
49 | - 'H' => 'HH', // 00, 01, ... 23 |
|
50 | - '#' => 'H', // 0, 1, ... 23 |
|
51 | - // MINUTES & SECONDS |
|
52 | - 'i' => 'mm', // minutes 00, 01, ..., 59 |
|
53 | - 's' => 'ss', // seconds 00, 01, ..., 59 |
|
54 | - 'v' => 'SSS', // milliseconds 000, 001, ..., 999 |
|
55 | - 'u' => 'SSS', // microseconds (not in unicode) 000, 001, ..., 999 |
|
56 | - ]; |
|
35 | + /** |
|
36 | + * array where keys are PHP time format parameters |
|
37 | + * and values are Unicode Time Format substitutions |
|
38 | + */ |
|
39 | + public static $time_formats = [ |
|
40 | + // 'a' => 'a', // am, pm, no pecific JS alternative |
|
41 | + 'A' => 'a', // AM, PM |
|
42 | + // HOUR |
|
43 | + // convert "g" to an intermediary format |
|
44 | + // to avoid its result getting replaced by "h" |
|
45 | + 'g' => '@', // 1, 2, ..., 12 |
|
46 | + 'h' => 'hh', // 01, 02, ..., 12 |
|
47 | + '@' => 'h', // 1, 2, ..., 12 |
|
48 | + 'G' => '#', // 0, 1, ... 23 |
|
49 | + 'H' => 'HH', // 00, 01, ... 23 |
|
50 | + '#' => 'H', // 0, 1, ... 23 |
|
51 | + // MINUTES & SECONDS |
|
52 | + 'i' => 'mm', // minutes 00, 01, ..., 59 |
|
53 | + 's' => 'ss', // seconds 00, 01, ..., 59 |
|
54 | + 'v' => 'SSS', // milliseconds 000, 001, ..., 999 |
|
55 | + 'u' => 'SSS', // microseconds (not in unicode) 000, 001, ..., 999 |
|
56 | + ]; |
|
57 | 57 | |
58 | 58 | |
59 | - /** |
|
60 | - * array where keys are PHP timezone format parameters |
|
61 | - * and values are Unicode Timezone Format substitutions |
|
62 | - */ |
|
63 | - public static $timezone_formats = [ |
|
64 | - 'Z' => 'ZZ', // -0100, +0000, ..., +1200 |
|
65 | - 'e' => 'Z', // Timezone identifier UTC, GMT, Atlantic/Azores to -01:00, +00:00, ... +12:00 |
|
66 | - 'T' => 'Z', // Timezone abbreviation EST, MDT to -01:00, +00:00, ... +12:00 |
|
67 | - 'P' => 'Z', // -01:00, +00:00, ... +12:00 |
|
68 | - 'O' => 'ZZ', // -0100, +0000, ..., +1200 |
|
69 | - ]; |
|
59 | + /** |
|
60 | + * array where keys are PHP timezone format parameters |
|
61 | + * and values are Unicode Timezone Format substitutions |
|
62 | + */ |
|
63 | + public static $timezone_formats = [ |
|
64 | + 'Z' => 'ZZ', // -0100, +0000, ..., +1200 |
|
65 | + 'e' => 'Z', // Timezone identifier UTC, GMT, Atlantic/Azores to -01:00, +00:00, ... +12:00 |
|
66 | + 'T' => 'Z', // Timezone abbreviation EST, MDT to -01:00, +00:00, ... +12:00 |
|
67 | + 'P' => 'Z', // -01:00, +00:00, ... +12:00 |
|
68 | + 'O' => 'ZZ', // -0100, +0000, ..., +1200 |
|
69 | + ]; |
|
70 | 70 | |
71 | 71 | |
72 | - /** |
|
73 | - * @param string $date_format |
|
74 | - * @return string |
|
75 | - */ |
|
76 | - public function convertDateFormat($date_format) |
|
77 | - { |
|
78 | - foreach (PhpToUnicode::$date_formats as $find => $replace) { |
|
79 | - $date_format = (string) str_replace($find, $replace, $date_format); |
|
80 | - } |
|
81 | - return $date_format; |
|
82 | - } |
|
72 | + /** |
|
73 | + * @param string $date_format |
|
74 | + * @return string |
|
75 | + */ |
|
76 | + public function convertDateFormat($date_format) |
|
77 | + { |
|
78 | + foreach (PhpToUnicode::$date_formats as $find => $replace) { |
|
79 | + $date_format = (string) str_replace($find, $replace, $date_format); |
|
80 | + } |
|
81 | + return $date_format; |
|
82 | + } |
|
83 | 83 | |
84 | 84 | |
85 | - /** |
|
86 | - * @param string $time_format |
|
87 | - * @return string |
|
88 | - */ |
|
89 | - public function convertTimeFormat($time_format) |
|
90 | - { |
|
91 | - foreach (PhpToUnicode::$time_formats as $find => $replace) { |
|
92 | - $time_format = (string) str_replace($find, $replace, $time_format); |
|
93 | - } |
|
94 | - // and just in case the timezone has been added |
|
95 | - foreach (PhpToUnicode::$timezone_formats as $find => $replace) { |
|
96 | - $time_format = (string) str_replace($find, $replace, $time_format); |
|
97 | - } |
|
98 | - return $time_format; |
|
99 | - } |
|
85 | + /** |
|
86 | + * @param string $time_format |
|
87 | + * @return string |
|
88 | + */ |
|
89 | + public function convertTimeFormat($time_format) |
|
90 | + { |
|
91 | + foreach (PhpToUnicode::$time_formats as $find => $replace) { |
|
92 | + $time_format = (string) str_replace($find, $replace, $time_format); |
|
93 | + } |
|
94 | + // and just in case the timezone has been added |
|
95 | + foreach (PhpToUnicode::$timezone_formats as $find => $replace) { |
|
96 | + $time_format = (string) str_replace($find, $replace, $time_format); |
|
97 | + } |
|
98 | + return $time_format; |
|
99 | + } |
|
100 | 100 | } |
@@ -10,23 +10,23 @@ discard block |
||
10 | 10 | */ |
11 | 11 | public static $date_formats = [ |
12 | 12 | // YEAR |
13 | - 'y' => 'yy', // 00, 01, ..., 99 |
|
14 | - 'Y' => 'yyyy', // 2000, 2001, ..., 2099 |
|
15 | - 'o' => 'GGGG', // ISO "week-numbering year" 2000, 2001, ..., 2099 |
|
13 | + 'y' => 'yy', // 00, 01, ..., 99 |
|
14 | + 'Y' => 'yyyy', // 2000, 2001, ..., 2099 |
|
15 | + 'o' => 'GGGG', // ISO "week-numbering year" 2000, 2001, ..., 2099 |
|
16 | 16 | // MONTH |
17 | - 'M' => 'MMM', // Jan, Feb, ..., Dec |
|
18 | - 'n' => 'M', // 1, 2, ..., 12 |
|
19 | - 'm' => 'MM', // 01, 02, ..., 12 |
|
20 | - 'F' => 'MMMM', // January, February, ..., December |
|
17 | + 'M' => 'MMM', // Jan, Feb, ..., Dec |
|
18 | + 'n' => 'M', // 1, 2, ..., 12 |
|
19 | + 'm' => 'MM', // 01, 02, ..., 12 |
|
20 | + 'F' => 'MMMM', // January, February, ..., December |
|
21 | 21 | // DAY |
22 | - 'd' => 'dd', // 01, 02, ..., 31 |
|
23 | - 'D' => 'eee', // Sun, Mon, ..., Sat |
|
24 | - 'jS' => 'do', // 1st, 2nd, ..., 31st |
|
25 | - 'j' => 'd', // 1, 2, ..., 31 |
|
26 | - 'l' => 'eeee', // Sunday, Monday, ..., Saturday |
|
27 | - 'N' => 'e', // Day of week 0, 1, ..., 6 |
|
28 | - 'w' => 'i', // ISO Day of week 1, 2, ..., 7 |
|
29 | - 'z' => 'D', // day of the year 0 - 365 to 1 - 366 |
|
22 | + 'd' => 'dd', // 01, 02, ..., 31 |
|
23 | + 'D' => 'eee', // Sun, Mon, ..., Sat |
|
24 | + 'jS' => 'do', // 1st, 2nd, ..., 31st |
|
25 | + 'j' => 'd', // 1, 2, ..., 31 |
|
26 | + 'l' => 'eeee', // Sunday, Monday, ..., Saturday |
|
27 | + 'N' => 'e', // Day of week 0, 1, ..., 6 |
|
28 | + 'w' => 'i', // ISO Day of week 1, 2, ..., 7 |
|
29 | + 'z' => 'D', // day of the year 0 - 365 to 1 - 366 |
|
30 | 30 | // WEEK |
31 | 31 | 'W' => 'w', |
32 | 32 | ]; |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | // HOUR |
43 | 43 | // convert "g" to an intermediary format |
44 | 44 | // to avoid its result getting replaced by "h" |
45 | - 'g' => '@', // 1, 2, ..., 12 |
|
46 | - 'h' => 'hh', // 01, 02, ..., 12 |
|
47 | - '@' => 'h', // 1, 2, ..., 12 |
|
48 | - 'G' => '#', // 0, 1, ... 23 |
|
49 | - 'H' => 'HH', // 00, 01, ... 23 |
|
50 | - '#' => 'H', // 0, 1, ... 23 |
|
45 | + 'g' => '@', // 1, 2, ..., 12 |
|
46 | + 'h' => 'hh', // 01, 02, ..., 12 |
|
47 | + '@' => 'h', // 1, 2, ..., 12 |
|
48 | + 'G' => '#', // 0, 1, ... 23 |
|
49 | + 'H' => 'HH', // 00, 01, ... 23 |
|
50 | + '#' => 'H', // 0, 1, ... 23 |
|
51 | 51 | // MINUTES & SECONDS |
52 | - 'i' => 'mm', // minutes 00, 01, ..., 59 |
|
53 | - 's' => 'ss', // seconds 00, 01, ..., 59 |
|
54 | - 'v' => 'SSS', // milliseconds 000, 001, ..., 999 |
|
55 | - 'u' => 'SSS', // microseconds (not in unicode) 000, 001, ..., 999 |
|
52 | + 'i' => 'mm', // minutes 00, 01, ..., 59 |
|
53 | + 's' => 'ss', // seconds 00, 01, ..., 59 |
|
54 | + 'v' => 'SSS', // milliseconds 000, 001, ..., 999 |
|
55 | + 'u' => 'SSS', // microseconds (not in unicode) 000, 001, ..., 999 |
|
56 | 56 | ]; |
57 | 57 | |
58 | 58 | |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | * and values are Unicode Timezone Format substitutions |
62 | 62 | */ |
63 | 63 | public static $timezone_formats = [ |
64 | - 'Z' => 'ZZ', // -0100, +0000, ..., +1200 |
|
65 | - 'e' => 'Z', // Timezone identifier UTC, GMT, Atlantic/Azores to -01:00, +00:00, ... +12:00 |
|
66 | - 'T' => 'Z', // Timezone abbreviation EST, MDT to -01:00, +00:00, ... +12:00 |
|
67 | - 'P' => 'Z', // -01:00, +00:00, ... +12:00 |
|
68 | - 'O' => 'ZZ', // -0100, +0000, ..., +1200 |
|
64 | + 'Z' => 'ZZ', // -0100, +0000, ..., +1200 |
|
65 | + 'e' => 'Z', // Timezone identifier UTC, GMT, Atlantic/Azores to -01:00, +00:00, ... +12:00 |
|
66 | + 'T' => 'Z', // Timezone abbreviation EST, MDT to -01:00, +00:00, ... +12:00 |
|
67 | + 'P' => 'Z', // -01:00, +00:00, ... +12:00 |
|
68 | + 'O' => 'ZZ', // -0100, +0000, ..., +1200 |
|
69 | 69 | ]; |
70 | 70 | |
71 | 71 |
@@ -18,75 +18,75 @@ |
||
18 | 18 | */ |
19 | 19 | interface AssetManagerInterface |
20 | 20 | { |
21 | - /** |
|
22 | - * @since 4.9.71.p |
|
23 | - * @return string |
|
24 | - */ |
|
25 | - public function assetNamespace(); |
|
21 | + /** |
|
22 | + * @since 4.9.71.p |
|
23 | + * @return string |
|
24 | + */ |
|
25 | + public function assetNamespace(); |
|
26 | 26 | |
27 | - /** |
|
28 | - * @since 4.9.62.p |
|
29 | - */ |
|
30 | - public function addAssets(); |
|
27 | + /** |
|
28 | + * @since 4.9.62.p |
|
29 | + */ |
|
30 | + public function addAssets(); |
|
31 | 31 | |
32 | 32 | |
33 | - /** |
|
34 | - * @param string $handle |
|
35 | - * @param string $source |
|
36 | - * @param array $dependencies |
|
37 | - * @param bool $load_in_footer |
|
38 | - * @return JavascriptAsset |
|
39 | - * @throws DuplicateCollectionIdentifierException |
|
40 | - * @throws InvalidDataTypeException |
|
41 | - * @throws InvalidEntityException |
|
42 | - * @since 4.9.62.p |
|
43 | - */ |
|
44 | - public function addJavascript( |
|
45 | - $handle, |
|
46 | - $source, |
|
47 | - array $dependencies = array(), |
|
48 | - $load_in_footer = true |
|
49 | - ); |
|
33 | + /** |
|
34 | + * @param string $handle |
|
35 | + * @param string $source |
|
36 | + * @param array $dependencies |
|
37 | + * @param bool $load_in_footer |
|
38 | + * @return JavascriptAsset |
|
39 | + * @throws DuplicateCollectionIdentifierException |
|
40 | + * @throws InvalidDataTypeException |
|
41 | + * @throws InvalidEntityException |
|
42 | + * @since 4.9.62.p |
|
43 | + */ |
|
44 | + public function addJavascript( |
|
45 | + $handle, |
|
46 | + $source, |
|
47 | + array $dependencies = array(), |
|
48 | + $load_in_footer = true |
|
49 | + ); |
|
50 | 50 | |
51 | 51 | |
52 | - /** |
|
53 | - * @since 4.9.71.p |
|
54 | - * @param string $handle |
|
55 | - * @param array $dependencies |
|
56 | - * @param bool $load_in_footer |
|
57 | - * @return JavascriptAsset |
|
58 | - */ |
|
59 | - public function addVendorJavascript( |
|
60 | - $handle, |
|
61 | - array $dependencies = array(), |
|
62 | - $load_in_footer = true |
|
63 | - ); |
|
52 | + /** |
|
53 | + * @since 4.9.71.p |
|
54 | + * @param string $handle |
|
55 | + * @param array $dependencies |
|
56 | + * @param bool $load_in_footer |
|
57 | + * @return JavascriptAsset |
|
58 | + */ |
|
59 | + public function addVendorJavascript( |
|
60 | + $handle, |
|
61 | + array $dependencies = array(), |
|
62 | + $load_in_footer = true |
|
63 | + ); |
|
64 | 64 | |
65 | 65 | |
66 | 66 | |
67 | - /** |
|
68 | - * @param string $handle |
|
69 | - * @param string $source |
|
70 | - * @param array $dependencies |
|
71 | - * @param string $media |
|
72 | - * @return StylesheetAsset |
|
73 | - * @throws DuplicateCollectionIdentifierException |
|
74 | - * @throws InvalidDataTypeException |
|
75 | - * @throws InvalidEntityException |
|
76 | - * @since 4.9.62.p |
|
77 | - */ |
|
78 | - public function addStylesheet( |
|
79 | - $handle, |
|
80 | - $source, |
|
81 | - array $dependencies = array(), |
|
82 | - $media = 'all' |
|
83 | - ); |
|
67 | + /** |
|
68 | + * @param string $handle |
|
69 | + * @param string $source |
|
70 | + * @param array $dependencies |
|
71 | + * @param string $media |
|
72 | + * @return StylesheetAsset |
|
73 | + * @throws DuplicateCollectionIdentifierException |
|
74 | + * @throws InvalidDataTypeException |
|
75 | + * @throws InvalidEntityException |
|
76 | + * @since 4.9.62.p |
|
77 | + */ |
|
78 | + public function addStylesheet( |
|
79 | + $handle, |
|
80 | + $source, |
|
81 | + array $dependencies = array(), |
|
82 | + $media = 'all' |
|
83 | + ); |
|
84 | 84 | |
85 | 85 | |
86 | - /** |
|
87 | - * @param string $handle |
|
88 | - * @return bool |
|
89 | - * @since 4.9.62.p |
|
90 | - */ |
|
91 | - public function enqueueAsset($handle); |
|
86 | + /** |
|
87 | + * @param string $handle |
|
88 | + * @return bool |
|
89 | + * @since 4.9.62.p |
|
90 | + */ |
|
91 | + public function enqueueAsset($handle); |
|
92 | 92 | } |
@@ -16,32 +16,32 @@ |
||
16 | 16 | class ManifestFile extends Asset |
17 | 17 | { |
18 | 18 | |
19 | - /** |
|
20 | - * Asset constructor. |
|
21 | - * |
|
22 | - * @param DomainInterface $domain |
|
23 | - * @throws InvalidDataTypeException |
|
24 | - */ |
|
25 | - public function __construct(DomainInterface $domain) |
|
26 | - { |
|
27 | - parent::__construct(Asset::TYPE_MANIFEST, $domain->assetNamespace(), $domain); |
|
28 | - } |
|
29 | - |
|
30 | - |
|
31 | - /** |
|
32 | - * @return string |
|
33 | - */ |
|
34 | - public function urlBase() |
|
35 | - { |
|
36 | - return $this->domain->distributionAssetsUrl(); |
|
37 | - } |
|
38 | - |
|
39 | - |
|
40 | - /** |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - public function filepath() |
|
44 | - { |
|
45 | - return $this->domain->distributionAssetsPath(); |
|
46 | - } |
|
19 | + /** |
|
20 | + * Asset constructor. |
|
21 | + * |
|
22 | + * @param DomainInterface $domain |
|
23 | + * @throws InvalidDataTypeException |
|
24 | + */ |
|
25 | + public function __construct(DomainInterface $domain) |
|
26 | + { |
|
27 | + parent::__construct(Asset::TYPE_MANIFEST, $domain->assetNamespace(), $domain); |
|
28 | + } |
|
29 | + |
|
30 | + |
|
31 | + /** |
|
32 | + * @return string |
|
33 | + */ |
|
34 | + public function urlBase() |
|
35 | + { |
|
36 | + return $this->domain->distributionAssetsUrl(); |
|
37 | + } |
|
38 | + |
|
39 | + |
|
40 | + /** |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + public function filepath() |
|
44 | + { |
|
45 | + return $this->domain->distributionAssetsPath(); |
|
46 | + } |
|
47 | 47 | } |
@@ -7,19 +7,19 @@ |
||
7 | 7 | abstract class Factory implements FactoryInterface |
8 | 8 | { |
9 | 9 | |
10 | - /** |
|
11 | - * @var LoaderInterface $loader |
|
12 | - */ |
|
13 | - protected $loader; |
|
10 | + /** |
|
11 | + * @var LoaderInterface $loader |
|
12 | + */ |
|
13 | + protected $loader; |
|
14 | 14 | |
15 | 15 | |
16 | - /** |
|
17 | - * RouteFactory constructor. |
|
18 | - * |
|
19 | - * @param LoaderInterface $loader |
|
20 | - */ |
|
21 | - public function __construct(LoaderInterface $loader) |
|
22 | - { |
|
23 | - $this->loader = $loader; |
|
24 | - } |
|
16 | + /** |
|
17 | + * RouteFactory constructor. |
|
18 | + * |
|
19 | + * @param LoaderInterface $loader |
|
20 | + */ |
|
21 | + public function __construct(LoaderInterface $loader) |
|
22 | + { |
|
23 | + $this->loader = $loader; |
|
24 | + } |
|
25 | 25 | } |