@@ -179,7 +179,7 @@ |
||
179 | 179 | * |
180 | 180 | * @param string $event_slug The slug of the event this reaction is for. |
181 | 181 | * |
182 | - * @return int|false The reaction ID, or false if not created. |
|
182 | + * @return integer The reaction ID, or false if not created. |
|
183 | 183 | */ |
184 | 184 | abstract protected function _create_reaction( $event_slug ); |
185 | 185 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * @since 1.0.0 |
62 | 62 | */ |
63 | - public function __construct( $slug, WordPoints_Hook_Reactor $reactor ) { |
|
63 | + public function __construct($slug, WordPoints_Hook_Reactor $reactor) { |
|
64 | 64 | |
65 | 65 | $this->slug = $slug; |
66 | 66 | $this->reactor = $reactor; |
@@ -84,33 +84,33 @@ discard block |
||
84 | 84 | * @since 1.0.0 |
85 | 85 | */ |
86 | 86 | public function get_context_id() { |
87 | - return wordpoints_entities_get_current_context_id( $this->context ); |
|
87 | + return wordpoints_entities_get_current_context_id($this->context); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
91 | 91 | * @since 1.0.0 |
92 | 92 | */ |
93 | - public function get_reaction( $id ) { |
|
93 | + public function get_reaction($id) { |
|
94 | 94 | |
95 | - if ( ! $this->reaction_exists( $id ) ) { |
|
95 | + if ( ! $this->reaction_exists($id)) { |
|
96 | 96 | return false; |
97 | 97 | } |
98 | 98 | |
99 | - return new $this->reaction_class( $id, $this ); |
|
99 | + return new $this->reaction_class($id, $this); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
103 | 103 | * @since 1.0.0 |
104 | 104 | */ |
105 | - public function create_reaction( array $settings ) { |
|
106 | - return $this->create_or_update_reaction( $settings ); |
|
105 | + public function create_reaction(array $settings) { |
|
106 | + return $this->create_or_update_reaction($settings); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
110 | 110 | * @since 1.0.0 |
111 | 111 | */ |
112 | - public function update_reaction( $id, array $settings ) { |
|
113 | - return $this->create_or_update_reaction( $settings, $id ); |
|
112 | + public function update_reaction($id, array $settings) { |
|
113 | + return $this->create_or_update_reaction($settings, $id); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
@@ -125,41 +125,41 @@ discard block |
||
125 | 125 | * The reaction object if created/updated successfully. False or a |
126 | 126 | * validator instance if not. |
127 | 127 | */ |
128 | - protected function create_or_update_reaction( array $settings, $id = null ) { |
|
128 | + protected function create_or_update_reaction(array $settings, $id = null) { |
|
129 | 129 | |
130 | - $is_new = ! isset( $id ); |
|
130 | + $is_new = ! isset($id); |
|
131 | 131 | |
132 | - if ( ! $is_new && ! $this->reaction_exists( $id ) ) { |
|
132 | + if ( ! $is_new && ! $this->reaction_exists($id)) { |
|
133 | 133 | return false; |
134 | 134 | } |
135 | 135 | |
136 | - $validator = new WordPoints_Hook_Reaction_Validator( $settings, $this->reactor ); |
|
136 | + $validator = new WordPoints_Hook_Reaction_Validator($settings, $this->reactor); |
|
137 | 137 | $settings = $validator->validate(); |
138 | 138 | |
139 | - if ( $validator->had_errors() ) { |
|
139 | + if ($validator->had_errors()) { |
|
140 | 140 | return $validator; |
141 | 141 | } |
142 | 142 | |
143 | - if ( $is_new ) { |
|
143 | + if ($is_new) { |
|
144 | 144 | |
145 | - $id = $this->_create_reaction( $settings['event'] ); |
|
145 | + $id = $this->_create_reaction($settings['event']); |
|
146 | 146 | |
147 | - if ( ! $id ) { |
|
147 | + if ( ! $id) { |
|
148 | 148 | return false; |
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | - $reaction = $this->get_reaction( $id ); |
|
152 | + $reaction = $this->get_reaction($id); |
|
153 | 153 | |
154 | - $reaction->update_event_slug( $settings['event'] ); |
|
154 | + $reaction->update_event_slug($settings['event']); |
|
155 | 155 | |
156 | - unset( $settings['event'] ); |
|
156 | + unset($settings['event']); |
|
157 | 157 | |
158 | - $this->reactor->update_settings( $reaction, $settings ); |
|
158 | + $this->reactor->update_settings($reaction, $settings); |
|
159 | 159 | |
160 | 160 | /** @var WordPoints_Hook_Extension $extension */ |
161 | - foreach ( wordpoints_hooks()->extensions->get_all() as $extension ) { |
|
162 | - $extension->update_settings( $reaction, $settings ); |
|
161 | + foreach (wordpoints_hooks()->extensions->get_all() as $extension) { |
|
162 | + $extension->update_settings($reaction, $settings); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @param array $settings The new settings for the reaction. |
170 | 170 | * @param bool $is_new Whether the reaction was just now created. |
171 | 171 | */ |
172 | - do_action( 'wordpoints_hook_reaction_save', $reaction, $settings, $is_new ); |
|
172 | + do_action('wordpoints_hook_reaction_save', $reaction, $settings, $is_new); |
|
173 | 173 | |
174 | 174 | return $reaction; |
175 | 175 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | * |
187 | 187 | * @return int|false The reaction ID, or false if not created. |
188 | 188 | */ |
189 | - abstract protected function _create_reaction( $event_slug ); |
|
189 | + abstract protected function _create_reaction($event_slug); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | // EOF |
@@ -7,26 +7,26 @@ |
||
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | 9 | |
10 | -add_action( 'wordpoints_init_app-apps', 'wordpoints_apps_init' ); |
|
11 | -add_action( 'wordpoints_init_app-entities', 'wordpoints_entities_app_init' ); |
|
10 | +add_action('wordpoints_init_app-apps', 'wordpoints_apps_init'); |
|
11 | +add_action('wordpoints_init_app-entities', 'wordpoints_entities_app_init'); |
|
12 | 12 | |
13 | -add_action( 'wordpoints_init_app_registry-apps-entities', 'wordpoints_entities_init' ); |
|
14 | -add_action( 'wordpoints_init_app_registry-entities-contexts', 'wordpoints_entity_contexts_init' ); |
|
13 | +add_action('wordpoints_init_app_registry-apps-entities', 'wordpoints_entities_init'); |
|
14 | +add_action('wordpoints_init_app_registry-entities-contexts', 'wordpoints_entity_contexts_init'); |
|
15 | 15 | |
16 | -add_action( 'wordpoints_init_app_registry-apps-data_types', 'wordpoints_data_types_init' ); |
|
16 | +add_action('wordpoints_init_app_registry-apps-data_types', 'wordpoints_data_types_init'); |
|
17 | 17 | |
18 | -add_action( 'wordpoints_init_app_registry-hooks-firers', 'wordpoints_hook_firers_init' ); |
|
19 | -add_action( 'wordpoints_init_app_registry-hooks-events', 'wordpoints_hook_events_init' ); |
|
20 | -add_action( 'wordpoints_init_app_registry-hooks-actions', 'wordpoints_hook_actions_init' ); |
|
21 | -add_action( 'wordpoints_init_app_registry-hooks-reactors', 'wordpoints_hook_reactors_init' ); |
|
22 | -add_action( 'wordpoints_init_app_registry-hooks-reaction_stores', 'wordpoints_hook_reaction_stores_init' ); |
|
23 | -add_action( 'wordpoints_init_app_registry-hooks-extensions', 'wordpoints_hook_extension_init' ); |
|
24 | -add_action( 'wordpoints_init_app_registry-hooks-conditions', 'wordpoints_hook_conditions_init' ); |
|
18 | +add_action('wordpoints_init_app_registry-hooks-firers', 'wordpoints_hook_firers_init'); |
|
19 | +add_action('wordpoints_init_app_registry-hooks-events', 'wordpoints_hook_events_init'); |
|
20 | +add_action('wordpoints_init_app_registry-hooks-actions', 'wordpoints_hook_actions_init'); |
|
21 | +add_action('wordpoints_init_app_registry-hooks-reactors', 'wordpoints_hook_reactors_init'); |
|
22 | +add_action('wordpoints_init_app_registry-hooks-reaction_stores', 'wordpoints_hook_reaction_stores_init'); |
|
23 | +add_action('wordpoints_init_app_registry-hooks-extensions', 'wordpoints_hook_extension_init'); |
|
24 | +add_action('wordpoints_init_app_registry-hooks-conditions', 'wordpoints_hook_conditions_init'); |
|
25 | 25 | |
26 | -add_action( 'wordpoints_modules_loaded', 'wordpoints_init_hooks' ); |
|
26 | +add_action('wordpoints_modules_loaded', 'wordpoints_init_hooks'); |
|
27 | 27 | |
28 | -add_action( 'init', 'wordpoints_hooks_api_add_global_cache_groups', 5 ); |
|
28 | +add_action('init', 'wordpoints_hooks_api_add_global_cache_groups', 5); |
|
29 | 29 | |
30 | -add_filter( 'wordpoints_user_can_view_points_log', 'wordpoints_hooks_user_can_view_points_log' ); |
|
30 | +add_filter('wordpoints_user_can_view_points_log', 'wordpoints_hooks_user_can_view_points_log'); |
|
31 | 31 | |
32 | 32 | // EOF |
@@ -35,18 +35,18 @@ |
||
35 | 35 | /** |
36 | 36 | * @since 1.0.0 |
37 | 37 | */ |
38 | - public function __construct( $id, WordPoints_Hook_Reaction_StoreI $store ) { |
|
38 | + public function __construct($id, WordPoints_Hook_Reaction_StoreI $store) { |
|
39 | 39 | |
40 | - $this->ID = wordpoints_int( $id ); |
|
40 | + $this->ID = wordpoints_int($id); |
|
41 | 41 | $this->store = $store; |
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
45 | 45 | * @since 1.0.0 |
46 | 46 | */ |
47 | - public function __get( $var ) { |
|
47 | + public function __get($var) { |
|
48 | 48 | |
49 | - if ( 'ID' === $var ) { |
|
49 | + if ('ID' === $var) { |
|
50 | 50 | return $this->ID; |
51 | 51 | } |
52 | 52 |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | * @since 1.0.0 |
26 | 26 | */ |
27 | 27 | public function get_event_slug() { |
28 | - return $this->store->get_reaction_event_from_index( $this->ID ); |
|
28 | + return $this->store->get_reaction_event_from_index($this->ID); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
32 | 32 | * @since 1.0.0 |
33 | 33 | */ |
34 | - public function update_event_slug( $event_slug ) { |
|
34 | + public function update_event_slug($event_slug) { |
|
35 | 35 | return $this->store->update_reaction_event_in_index( |
36 | 36 | $this->ID |
37 | 37 | , $event_slug |
@@ -41,63 +41,63 @@ discard block |
||
41 | 41 | /** |
42 | 42 | * @since 1.0.0 |
43 | 43 | */ |
44 | - public function get_meta( $key ) { |
|
44 | + public function get_meta($key) { |
|
45 | 45 | |
46 | 46 | $settings = $this->get_settings(); |
47 | 47 | |
48 | - if ( ! is_array( $settings ) || ! isset( $settings[ $key ] ) ) { |
|
48 | + if ( ! is_array($settings) || ! isset($settings[$key])) { |
|
49 | 49 | return false; |
50 | 50 | } |
51 | 51 | |
52 | - return $settings[ $key ]; |
|
52 | + return $settings[$key]; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @since 1.0.0 |
57 | 57 | */ |
58 | - public function add_meta( $key, $value ) { |
|
58 | + public function add_meta($key, $value) { |
|
59 | 59 | |
60 | 60 | $settings = $this->get_settings(); |
61 | 61 | |
62 | - if ( ! is_array( $settings ) || isset( $settings[ $key ] ) ) { |
|
62 | + if ( ! is_array($settings) || isset($settings[$key])) { |
|
63 | 63 | return false; |
64 | 64 | } |
65 | 65 | |
66 | - $settings[ $key ] = $value; |
|
66 | + $settings[$key] = $value; |
|
67 | 67 | |
68 | - return $this->update_settings( $settings ); |
|
68 | + return $this->update_settings($settings); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @since 1.0.0 |
73 | 73 | */ |
74 | - public function update_meta( $key, $value ) { |
|
74 | + public function update_meta($key, $value) { |
|
75 | 75 | |
76 | 76 | $settings = $this->get_settings(); |
77 | 77 | |
78 | - if ( ! is_array( $settings ) ) { |
|
78 | + if ( ! is_array($settings)) { |
|
79 | 79 | return false; |
80 | 80 | } |
81 | 81 | |
82 | - $settings[ $key ] = $value; |
|
82 | + $settings[$key] = $value; |
|
83 | 83 | |
84 | - return $this->update_settings( $settings ); |
|
84 | + return $this->update_settings($settings); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
88 | 88 | * @since 1.0.0 |
89 | 89 | */ |
90 | - public function delete_meta( $key ) { |
|
90 | + public function delete_meta($key) { |
|
91 | 91 | |
92 | 92 | $settings = $this->get_settings(); |
93 | 93 | |
94 | - if ( ! is_array( $settings ) || ! isset( $settings[ $key ] ) ) { |
|
94 | + if ( ! is_array($settings) || ! isset($settings[$key])) { |
|
95 | 95 | return false; |
96 | 96 | } |
97 | 97 | |
98 | - unset( $settings[ $key ] ); |
|
98 | + unset($settings[$key]); |
|
99 | 99 | |
100 | - return $this->update_settings( $settings ); |
|
100 | + return $this->update_settings($settings); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | protected function get_settings() { |
118 | 118 | |
119 | 119 | return $this->store->get_option( |
120 | - $this->store->get_settings_option_name( $this->ID ) |
|
120 | + $this->store->get_settings_option_name($this->ID) |
|
121 | 121 | ); |
122 | 122 | } |
123 | 123 | |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @return bool Whether the settings were updated successfully. |
132 | 132 | */ |
133 | - protected function update_settings( $settings ) { |
|
133 | + protected function update_settings($settings) { |
|
134 | 134 | |
135 | 135 | return $this->store->update_option( |
136 | - $this->store->get_settings_option_name( $this->ID ) |
|
136 | + $this->store->get_settings_option_name($this->ID) |
|
137 | 137 | , $settings |
138 | 138 | ); |
139 | 139 | } |
@@ -22,25 +22,25 @@ discard block |
||
22 | 22 | /** |
23 | 23 | * @since 1.0.0 |
24 | 24 | */ |
25 | - public function reaction_exists( $id ) { |
|
26 | - return (bool) $this->get_option( $this->get_settings_option_name( $id ) ); |
|
25 | + public function reaction_exists($id) { |
|
26 | + return (bool) $this->get_option($this->get_settings_option_name($id)); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @since 1.0.0 |
31 | 31 | */ |
32 | 32 | public function get_reactions() { |
33 | - return $this->create_reaction_objects( $this->get_reaction_index() ); |
|
33 | + return $this->create_reaction_objects($this->get_reaction_index()); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @since 1.0.0 |
38 | 38 | */ |
39 | - public function get_reactions_to_event( $event_slug ) { |
|
39 | + public function get_reactions_to_event($event_slug) { |
|
40 | 40 | |
41 | 41 | $index = $this->get_reaction_index(); |
42 | - $index = wp_list_filter( $index, array( 'event' => $event_slug ) ); |
|
43 | - return $this->create_reaction_objects( $index ); |
|
42 | + $index = wp_list_filter($index, array('event' => $event_slug)); |
|
43 | + return $this->create_reaction_objects($index); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | */ |
60 | 60 | protected function get_reaction_index() { |
61 | 61 | |
62 | - $index = $this->get_option( $this->get_reaction_index_option_name() ); |
|
62 | + $index = $this->get_option($this->get_reaction_index_option_name()); |
|
63 | 63 | |
64 | - if ( ! is_array( $index ) ) { |
|
64 | + if ( ! is_array($index)) { |
|
65 | 65 | $index = array(); |
66 | 66 | } |
67 | 67 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * |
78 | 78 | * @return bool Whether the index was updated successfully. |
79 | 79 | */ |
80 | - protected function update_reaction_index( $index ) { |
|
80 | + protected function update_reaction_index($index) { |
|
81 | 81 | |
82 | 82 | return $this->update_option( |
83 | 83 | $this->get_reaction_index_option_name() |
@@ -96,15 +96,15 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @return string|false The event slug, or false if not found. |
98 | 98 | */ |
99 | - public function get_reaction_event_from_index( $id ) { |
|
99 | + public function get_reaction_event_from_index($id) { |
|
100 | 100 | |
101 | 101 | $index = $this->get_reaction_index(); |
102 | 102 | |
103 | - if ( ! isset( $index[ $id ]['event'] ) ) { |
|
103 | + if ( ! isset($index[$id]['event'])) { |
|
104 | 104 | return false; |
105 | 105 | } |
106 | 106 | |
107 | - return $index[ $id ]['event']; |
|
107 | + return $index[$id]['event']; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -119,17 +119,17 @@ discard block |
||
119 | 119 | * |
120 | 120 | * @return bool Whether the event was updated successfully. |
121 | 121 | */ |
122 | - public function update_reaction_event_in_index( $id, $event ) { |
|
122 | + public function update_reaction_event_in_index($id, $event) { |
|
123 | 123 | |
124 | 124 | $index = $this->get_reaction_index(); |
125 | 125 | |
126 | - if ( ! isset( $index[ $id ] ) ) { |
|
126 | + if ( ! isset($index[$id])) { |
|
127 | 127 | return false; |
128 | 128 | } |
129 | 129 | |
130 | - $index[ $id ]['event'] = $event; |
|
130 | + $index[$id]['event'] = $event; |
|
131 | 131 | |
132 | - return $this->update_reaction_index( $index ); |
|
132 | + return $this->update_reaction_index($index); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -141,15 +141,15 @@ discard block |
||
141 | 141 | * |
142 | 142 | * @return WordPoints_Hook_Reaction_Options[] The objects for the reactions. |
143 | 143 | */ |
144 | - protected function create_reaction_objects( $index ) { |
|
144 | + protected function create_reaction_objects($index) { |
|
145 | 145 | |
146 | 146 | $reactions = array(); |
147 | 147 | |
148 | - foreach ( $index as $reaction ) { |
|
148 | + foreach ($index as $reaction) { |
|
149 | 149 | |
150 | - $object = $this->get_reaction( $reaction['id'] ); |
|
150 | + $object = $this->get_reaction($reaction['id']); |
|
151 | 151 | |
152 | - if ( ! $object ) { |
|
152 | + if ( ! $object) { |
|
153 | 153 | continue; |
154 | 154 | } |
155 | 155 | |
@@ -162,53 +162,53 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * @since 1.0.0 |
164 | 164 | */ |
165 | - public function delete_reaction( $id ) { |
|
165 | + public function delete_reaction($id) { |
|
166 | 166 | |
167 | - if ( ! $this->reaction_exists( $id ) ) { |
|
167 | + if ( ! $this->reaction_exists($id)) { |
|
168 | 168 | return false; |
169 | 169 | } |
170 | 170 | |
171 | - $result = $this->delete_option( $this->get_settings_option_name( $id ) ); |
|
171 | + $result = $this->delete_option($this->get_settings_option_name($id)); |
|
172 | 172 | |
173 | - if ( ! $result ) { |
|
173 | + if ( ! $result) { |
|
174 | 174 | return false; |
175 | 175 | } |
176 | 176 | |
177 | 177 | $index = $this->get_reaction_index(); |
178 | 178 | |
179 | - unset( $index[ $id ] ); |
|
179 | + unset($index[$id]); |
|
180 | 180 | |
181 | - return $this->update_reaction_index( $index ); |
|
181 | + return $this->update_reaction_index($index); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
185 | 185 | * @since 1.0.0 |
186 | 186 | */ |
187 | - protected function _create_reaction( $event_slug ) { |
|
187 | + protected function _create_reaction($event_slug) { |
|
188 | 188 | |
189 | 189 | $index = $this->get_reaction_index(); |
190 | 190 | |
191 | 191 | $id = 1; |
192 | 192 | |
193 | 193 | // TODO this is fragile when the newest reaction gets deleted. |
194 | - if ( ! empty( $index ) ) { |
|
195 | - $id = 1 + max( array_keys( $index ) ); |
|
194 | + if ( ! empty($index)) { |
|
195 | + $id = 1 + max(array_keys($index)); |
|
196 | 196 | } |
197 | 197 | |
198 | - $settings = array( 'event' => $event_slug ); |
|
198 | + $settings = array('event' => $event_slug); |
|
199 | 199 | |
200 | 200 | $result = $this->add_option( |
201 | - $this->get_settings_option_name( $id ) |
|
201 | + $this->get_settings_option_name($id) |
|
202 | 202 | , $settings |
203 | 203 | ); |
204 | 204 | |
205 | - if ( ! $result ) { |
|
205 | + if ( ! $result) { |
|
206 | 206 | return false; |
207 | 207 | } |
208 | 208 | |
209 | - $index[ $id ] = array( 'event' => $event_slug, 'id' => $id ); |
|
209 | + $index[$id] = array('event' => $event_slug, 'id' => $id); |
|
210 | 210 | |
211 | - if ( ! $this->update_reaction_index( $index ) ) { |
|
211 | + if ( ! $this->update_reaction_index($index)) { |
|
212 | 212 | return false; |
213 | 213 | } |
214 | 214 | |
@@ -226,8 +226,8 @@ discard block |
||
226 | 226 | * |
227 | 227 | * @return mixed The option value, or false. |
228 | 228 | */ |
229 | - public function get_option( $name ) { |
|
230 | - return get_option( $name ); |
|
229 | + public function get_option($name) { |
|
230 | + return get_option($name); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | /** |
@@ -240,8 +240,8 @@ discard block |
||
240 | 240 | * |
241 | 241 | * @return bool Whether the option was added successfully. |
242 | 242 | */ |
243 | - protected function add_option( $name, $value ) { |
|
244 | - return add_option( $name, $value ); |
|
243 | + protected function add_option($name, $value) { |
|
244 | + return add_option($name, $value); |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
@@ -256,8 +256,8 @@ discard block |
||
256 | 256 | * |
257 | 257 | * @return bool Whether the option was updated successfully. |
258 | 258 | */ |
259 | - public function update_option( $name, $value ) { |
|
260 | - return update_option( $name, $value ); |
|
259 | + public function update_option($name, $value) { |
|
260 | + return update_option($name, $value); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | /** |
@@ -269,8 +269,8 @@ discard block |
||
269 | 269 | * |
270 | 270 | * @return bool Whether the option was deleted successfully. |
271 | 271 | */ |
272 | - protected function delete_option( $name ) { |
|
273 | - return delete_option( $name ); |
|
272 | + protected function delete_option($name) { |
|
273 | + return delete_option($name); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | /** |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * |
283 | 283 | * @return string The name of the option where the settings are stored. |
284 | 284 | */ |
285 | - public function get_settings_option_name( $id ) { |
|
285 | + public function get_settings_option_name($id) { |
|
286 | 286 | return "wordpoints_{$this->reactor_slug}_hook_reaction-{$id}"; |
287 | 287 | } |
288 | 288 |
@@ -22,29 +22,29 @@ |
||
22 | 22 | /** |
23 | 23 | * @since 1.0.0 |
24 | 24 | */ |
25 | - public function get_option( $name ) { |
|
26 | - return get_site_option( $name ); |
|
25 | + public function get_option($name) { |
|
26 | + return get_site_option($name); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | 30 | * @since 1.0.0 |
31 | 31 | */ |
32 | - protected function add_option( $name, $value ) { |
|
33 | - return add_site_option( $name, $value ); |
|
32 | + protected function add_option($name, $value) { |
|
33 | + return add_site_option($name, $value); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
37 | 37 | * @since 1.0.0 |
38 | 38 | */ |
39 | - public function update_option( $name, $value ) { |
|
40 | - return update_site_option( $name, $value ); |
|
39 | + public function update_option($name, $value) { |
|
40 | + return update_site_option($name, $value); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
44 | 44 | * @since 1.0.0 |
45 | 45 | */ |
46 | - protected function delete_option( $name ) { |
|
47 | - return delete_site_option( $name ); |
|
46 | + protected function delete_option($name) { |
|
47 | + return delete_site_option($name); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param string $slug The slug of this storage group. |
26 | 26 | * @param WordPoints_Hook_Reactor $reactor The reactor the reactions belong to. |
27 | 27 | */ |
28 | - public function __construct( $slug, WordPoints_Hook_Reactor $reactor ); |
|
28 | + public function __construct($slug, WordPoints_Hook_Reactor $reactor); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Get the slug of this reaction storage group. |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @return bool Whether the reaction exists. |
71 | 71 | */ |
72 | - public function reaction_exists( $id ); |
|
72 | + public function reaction_exists($id); |
|
73 | 73 | |
74 | 74 | /** |
75 | 75 | * Get an reaction object. |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @return WordPoints_Hook_ReactionI|false The reaction, or false if nonexistent. |
82 | 82 | */ |
83 | - public function get_reaction( $id ); |
|
83 | + public function get_reaction($id); |
|
84 | 84 | |
85 | 85 | /** |
86 | 86 | * Create an reaction. |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * The reaction object if created successfully. False or a validator |
94 | 94 | * instance if not. |
95 | 95 | */ |
96 | - public function create_reaction( array $settings ); |
|
96 | + public function create_reaction(array $settings); |
|
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Update an reaction. |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | * The reaction object if updated successfully. False or a validator |
108 | 108 | * instance if not. |
109 | 109 | */ |
110 | - public function update_reaction( $id, array $settings ); |
|
110 | + public function update_reaction($id, array $settings); |
|
111 | 111 | |
112 | 112 | /** |
113 | 113 | * Delete an reaction. |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * |
119 | 119 | * @return bool Whether the reaction was deleted successfully. |
120 | 120 | */ |
121 | - public function delete_reaction( $id ); |
|
121 | + public function delete_reaction($id); |
|
122 | 122 | |
123 | 123 | /** |
124 | 124 | * Get all hook reactions for the reactor. |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | * |
142 | 142 | * @return WordPoints_Hook_ReactionI[] |
143 | 143 | */ |
144 | - public function get_reactions_to_event( $event_slug ); |
|
144 | + public function get_reactions_to_event($event_slug); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | // EOF |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param int $id The ID of a hook reaction. |
26 | 26 | * @param WordPoints_Hook_Reaction_StoreI $store The storage object. |
27 | 27 | */ |
28 | - public function __construct( $id, WordPoints_Hook_Reaction_StoreI $store ); |
|
28 | + public function __construct($id, WordPoints_Hook_Reaction_StoreI $store); |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Get a Globally Unique ID for this reaction. |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @return bool Whether the event was updated successfully. |
69 | 69 | */ |
70 | - public function update_event_slug( $event_slug ); |
|
70 | + public function update_event_slug($event_slug); |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * Get the slug of the reactor this reaction is for. |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @return mixed|false The meta value, or false if not found. |
102 | 102 | */ |
103 | - public function get_meta( $key ); |
|
103 | + public function get_meta($key); |
|
104 | 104 | |
105 | 105 | /** |
106 | 106 | * Add a piece of metadata for this reaction. |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @return bool Whether the metadata was added successfully. |
116 | 116 | */ |
117 | - public function add_meta( $key, $value ); |
|
117 | + public function add_meta($key, $value); |
|
118 | 118 | |
119 | 119 | /** |
120 | 120 | * Update a piece of metadata for this reaction. |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * |
127 | 127 | * @return bool Whether the metadata was updated successfully. |
128 | 128 | */ |
129 | - public function update_meta( $key, $value ); |
|
129 | + public function update_meta($key, $value); |
|
130 | 130 | |
131 | 131 | /** |
132 | 132 | * Delete a piece of metadata for this reaction. |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * |
138 | 138 | * @return bool Whether the metadata was deleted successfully. |
139 | 139 | */ |
140 | - public function delete_meta( $key ); |
|
140 | + public function delete_meta($key); |
|
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Get all of the metadata for this reaction. |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | protected function init() { |
48 | 48 | |
49 | 49 | $sub_apps = $this->sub_apps; |
50 | - $sub_apps->register( 'router', 'WordPoints_Hook_Router' ); |
|
51 | - $sub_apps->register( 'actions', 'WordPoints_Hook_Actions' ); |
|
52 | - $sub_apps->register( 'events', 'WordPoints_Hook_Events' ); |
|
53 | - $sub_apps->register( 'firers', 'WordPoints_Class_Registry_Persistent' ); |
|
54 | - $sub_apps->register( 'reactors', 'WordPoints_Class_Registry_Persistent' ); |
|
55 | - $sub_apps->register( 'reaction_stores', 'WordPoints_Class_Registry_Children' ); |
|
56 | - $sub_apps->register( 'extensions', 'WordPoints_Class_Registry_Persistent' ); |
|
57 | - $sub_apps->register( 'conditions', 'WordPoints_Class_Registry_Children' ); |
|
50 | + $sub_apps->register('router', 'WordPoints_Hook_Router'); |
|
51 | + $sub_apps->register('actions', 'WordPoints_Hook_Actions'); |
|
52 | + $sub_apps->register('events', 'WordPoints_Hook_Events'); |
|
53 | + $sub_apps->register('firers', 'WordPoints_Class_Registry_Persistent'); |
|
54 | + $sub_apps->register('reactors', 'WordPoints_Class_Registry_Persistent'); |
|
55 | + $sub_apps->register('reaction_stores', 'WordPoints_Class_Registry_Children'); |
|
56 | + $sub_apps->register('extensions', 'WordPoints_Class_Registry_Persistent'); |
|
57 | + $sub_apps->register('conditions', 'WordPoints_Class_Registry_Children'); |
|
58 | 58 | |
59 | 59 | parent::init(); |
60 | 60 | } |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function get_current_mode() { |
79 | 79 | |
80 | - if ( ! isset( $this->current_mode ) ) { |
|
81 | - $this->current_mode = ( wordpoints_is_network_context() ? 'network' : 'standard' ); |
|
80 | + if ( ! isset($this->current_mode)) { |
|
81 | + $this->current_mode = (wordpoints_is_network_context() ? 'network' : 'standard'); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | return $this->current_mode; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @param string $mode The slug of the mode to set as the current mode. |
98 | 98 | */ |
99 | - public function set_current_mode( $mode ) { |
|
99 | + public function set_current_mode($mode) { |
|
100 | 100 | $this->current_mode = $mode; |
101 | 101 | } |
102 | 102 | } |