@@ -36,7 +36,7 @@ |
||
36 | 36 | * |
37 | 37 | * @return bool Whether the target should be hit by this hook firing. |
38 | 38 | */ |
39 | - public function should_hit( WordPoints_Hook_Fire $fire ); |
|
39 | + public function should_hit(WordPoints_Hook_Fire $fire); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | // EOF |
@@ -76,7 +76,7 @@ |
||
76 | 76 | * |
77 | 77 | * @param WordPoints_Hook_Fire $fire The hook fire object. |
78 | 78 | */ |
79 | - public function hit( WordPoints_Hook_Fire $fire ); |
|
79 | + public function hit(WordPoints_Hook_Fire $fire); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | // EOF |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @return bool Whether the reaction exists. |
52 | 52 | */ |
53 | - public function reaction_exists( $id ); |
|
53 | + public function reaction_exists($id); |
|
54 | 54 | |
55 | 55 | /** |
56 | 56 | * Get an reaction object. |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * |
62 | 62 | * @return WordPoints_Hook_ReactionI|false The reaction, or false if nonexistent. |
63 | 63 | */ |
64 | - public function get_reaction( $id ); |
|
64 | + public function get_reaction($id); |
|
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Create an reaction. |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * The reaction object if created successfully. False or a validator |
75 | 75 | * instance if not. |
76 | 76 | */ |
77 | - public function create_reaction( array $settings ); |
|
77 | + public function create_reaction(array $settings); |
|
78 | 78 | |
79 | 79 | /** |
80 | 80 | * Update an reaction. |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * The reaction object if updated successfully. False or a validator |
89 | 89 | * instance if not. |
90 | 90 | */ |
91 | - public function update_reaction( $id, array $settings ); |
|
91 | + public function update_reaction($id, array $settings); |
|
92 | 92 | |
93 | 93 | /** |
94 | 94 | * Delete an reaction. |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * |
100 | 100 | * @return bool Whether the reaction was deleted successfully. |
101 | 101 | */ |
102 | - public function delete_reaction( $id ); |
|
102 | + public function delete_reaction($id); |
|
103 | 103 | |
104 | 104 | /** |
105 | 105 | * Get all hook reactions for the reactor. |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * |
123 | 123 | * @return WordPoints_Hook_ReactionI[] |
124 | 124 | */ |
125 | - public function get_reactions_to_event( $event_slug ); |
|
125 | + public function get_reactions_to_event($event_slug); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | // EOF |
@@ -111,21 +111,21 @@ discard block |
||
111 | 111 | ) { |
112 | 112 | |
113 | 113 | if ( |
114 | - empty( $settings['target'] ) |
|
115 | - || ! is_array( $settings['target'] ) |
|
114 | + empty($settings['target']) |
|
115 | + || ! is_array($settings['target']) |
|
116 | 116 | ) { |
117 | 117 | |
118 | - $validator->add_error( __( 'Invalid target.', 'wordpoints' ), 'target' ); |
|
118 | + $validator->add_error(__('Invalid target.', 'wordpoints'), 'target'); |
|
119 | 119 | |
120 | 120 | } else { |
121 | 121 | |
122 | - $target = $event_args->get_from_hierarchy( $settings['target'] ); |
|
122 | + $target = $event_args->get_from_hierarchy($settings['target']); |
|
123 | 123 | |
124 | 124 | if ( |
125 | 125 | ! $target instanceof WordPoints_Entity |
126 | - || ! in_array( $target->get_slug(), (array) $this->arg_types ) |
|
126 | + || ! in_array($target->get_slug(), (array) $this->arg_types) |
|
127 | 127 | ) { |
128 | - $validator->add_error( __( 'Invalid target.', 'wordpoints' ), 'target' ); |
|
128 | + $validator->add_error(__('Invalid target.', 'wordpoints'), 'target'); |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | /** |
136 | 136 | * @since 1.0.0 |
137 | 137 | */ |
138 | - public function update_settings( WordPoints_Hook_ReactionI $reaction, array $settings ) { |
|
139 | - $reaction->update_meta( 'target', $settings['target'] ); |
|
138 | + public function update_settings(WordPoints_Hook_ReactionI $reaction, array $settings) { |
|
139 | + $reaction->update_meta('target', $settings['target']); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * |
58 | 58 | * @return bool Whether the event was updated successfully. |
59 | 59 | */ |
60 | - public function update_event_slug( $event_slug ); |
|
60 | + public function update_event_slug($event_slug); |
|
61 | 61 | |
62 | 62 | /** |
63 | 63 | * Get the slug of the reactor this reaction is for. |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * |
91 | 91 | * @return mixed|false The meta value, or false if not found. |
92 | 92 | */ |
93 | - public function get_meta( $key ); |
|
93 | + public function get_meta($key); |
|
94 | 94 | |
95 | 95 | /** |
96 | 96 | * Add a piece of metadata for this reaction. |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * |
105 | 105 | * @return bool Whether the metadata was added successfully. |
106 | 106 | */ |
107 | - public function add_meta( $key, $value ); |
|
107 | + public function add_meta($key, $value); |
|
108 | 108 | |
109 | 109 | /** |
110 | 110 | * Update a piece of metadata for this reaction. |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * |
117 | 117 | * @return bool Whether the metadata was updated successfully. |
118 | 118 | */ |
119 | - public function update_meta( $key, $value ); |
|
119 | + public function update_meta($key, $value); |
|
120 | 120 | |
121 | 121 | /** |
122 | 122 | * Delete a piece of metadata for this reaction. |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * |
128 | 128 | * @return bool Whether the metadata was deleted successfully. |
129 | 129 | */ |
130 | - public function delete_meta( $key ); |
|
130 | + public function delete_meta($key); |
|
131 | 131 | |
132 | 132 | /** |
133 | 133 | * Get all of the metadata for this reaction. |
@@ -10,128 +10,128 @@ |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // auto-generated { |
13 | -$dir = dirname( __FILE__ ); |
|
14 | -require_once( $dir . '/specedi.php' ); |
|
15 | -require_once( $dir . '/hook/ui/script/data/provideri.php' ); |
|
16 | -require_once( $dir . '/hook/settingsi.php' ); |
|
17 | -require_once( $dir . '/hook/retroactive/queryi.php' ); |
|
18 | -require_once( $dir . '/hook/retroactive/query/modifieri.php' ); |
|
19 | -require_once( $dir . '/hook/reactori.php' ); |
|
20 | -require_once( $dir . '/hook/reactioni.php' ); |
|
21 | -require_once( $dir . '/hook/reaction/storei.php' ); |
|
22 | -require_once( $dir . '/hook/extensioni.php' ); |
|
23 | -require_once( $dir . '/hook/extension/miss/listeneri.php' ); |
|
24 | -require_once( $dir . '/hook/extension/hit/listeneri.php' ); |
|
25 | -require_once( $dir . '/hook/eventi.php' ); |
|
26 | -require_once( $dir . '/hook/event/reversingi.php' ); |
|
27 | -require_once( $dir . '/hook/conditioni.php' ); |
|
28 | -require_once( $dir . '/hook/argi.php' ); |
|
29 | -require_once( $dir . '/hook/actioni.php' ); |
|
30 | -require_once( $dir . '/entityishi.php' ); |
|
31 | -require_once( $dir . '/entityish/storedi.php' ); |
|
32 | -require_once( $dir . '/entity/restricted/visibilityi.php' ); |
|
33 | -require_once( $dir . '/entity/parenti.php' ); |
|
34 | -require_once( $dir . '/entity/hierarchyi.php' ); |
|
35 | -require_once( $dir . '/entity/enumerablei.php' ); |
|
36 | -require_once( $dir . '/entity/childi.php' ); |
|
37 | -require_once( $dir . '/data/typei.php' ); |
|
38 | -require_once( $dir . '/class/registryi.php' ); |
|
39 | -require_once( $dir . '/class/registry/childreni.php' ); |
|
40 | -require_once( $dir . '/app.php' ); |
|
41 | -require_once( $dir . '/app/registry.php' ); |
|
42 | -require_once( $dir . '/class/autoloader.php' ); |
|
43 | -require_once( $dir . '/class/registry.php' ); |
|
44 | -require_once( $dir . '/class/registry/children.php' ); |
|
45 | -require_once( $dir . '/class/registry/persistent.php' ); |
|
46 | -require_once( $dir . '/data/type.php' ); |
|
47 | -require_once( $dir . '/data/type/integer.php' ); |
|
48 | -require_once( $dir . '/data/type/text.php' ); |
|
49 | -require_once( $dir . '/db/query.php' ); |
|
50 | -require_once( $dir . '/entityish.php' ); |
|
51 | -require_once( $dir . '/entity.php' ); |
|
52 | -require_once( $dir . '/entity/relationship.php' ); |
|
53 | -require_once( $dir . '/entity/relationship/dynamic.php' ); |
|
54 | -require_once( $dir . '/entity/relationship/stored/field.php' ); |
|
55 | -require_once( $dir . '/entity/stored/array.php' ); |
|
56 | -require_once( $dir . '/entity/stored/db/table.php' ); |
|
57 | -require_once( $dir . '/entity/array.php' ); |
|
58 | -require_once( $dir . '/entity/attr.php' ); |
|
59 | -require_once( $dir . '/entity/attr/field.php' ); |
|
60 | -require_once( $dir . '/entity/change.php' ); |
|
61 | -require_once( $dir . '/entity/comment.php' ); |
|
62 | -require_once( $dir . '/entity/comment/author.php' ); |
|
63 | -require_once( $dir . '/entity/comment/post.php' ); |
|
64 | -require_once( $dir . '/entity/context.php' ); |
|
65 | -require_once( $dir . '/entity/context/network.php' ); |
|
66 | -require_once( $dir . '/entity/context/site.php' ); |
|
67 | -require_once( $dir . '/entity/hierarchy.php' ); |
|
68 | -require_once( $dir . '/entity/post.php' ); |
|
69 | -require_once( $dir . '/entity/post/author.php' ); |
|
70 | -require_once( $dir . '/entity/post/content.php' ); |
|
71 | -require_once( $dir . '/entity/post/terms.php' ); |
|
72 | -require_once( $dir . '/entity/post/type.php' ); |
|
73 | -require_once( $dir . '/entity/post/type/name.php' ); |
|
74 | -require_once( $dir . '/entity/post/type/relationship.php' ); |
|
75 | -require_once( $dir . '/entity/site.php' ); |
|
76 | -require_once( $dir . '/entity/term.php' ); |
|
77 | -require_once( $dir . '/entity/term/id.php' ); |
|
78 | -require_once( $dir . '/entity/user.php' ); |
|
79 | -require_once( $dir . '/entity/user/role.php' ); |
|
80 | -require_once( $dir . '/entity/user/role/name.php' ); |
|
81 | -require_once( $dir . '/entity/user/roles.php' ); |
|
82 | -require_once( $dir . '/hierarchy.php' ); |
|
83 | -require_once( $dir . '/hook/action.php' ); |
|
84 | -require_once( $dir . '/hook/action/comment/new.php' ); |
|
85 | -require_once( $dir . '/hook/action/post/depublish/delete.php' ); |
|
86 | -require_once( $dir . '/hook/action/post/publish.php' ); |
|
87 | -require_once( $dir . '/hook/actions.php' ); |
|
88 | -require_once( $dir . '/hook/arg.php' ); |
|
89 | -require_once( $dir . '/hook/arg/current/post.php' ); |
|
90 | -require_once( $dir . '/hook/arg/current/site.php' ); |
|
91 | -require_once( $dir . '/hook/arg/current/user.php' ); |
|
92 | -require_once( $dir . '/hook/arg/dynamic.php' ); |
|
93 | -require_once( $dir . '/hook/condition.php' ); |
|
94 | -require_once( $dir . '/hook/condition/entity/array/contains.php' ); |
|
95 | -require_once( $dir . '/hook/condition/equals.php' ); |
|
96 | -require_once( $dir . '/hook/condition/string/contains.php' ); |
|
97 | -require_once( $dir . '/hook/event.php' ); |
|
98 | -require_once( $dir . '/hook/event/dynamic.php' ); |
|
99 | -require_once( $dir . '/hook/event/args.php' ); |
|
100 | -require_once( $dir . '/hook/event/comment/leave.php' ); |
|
101 | -require_once( $dir . '/hook/event/media/upload.php' ); |
|
102 | -require_once( $dir . '/hook/event/post/publish.php' ); |
|
103 | -require_once( $dir . '/hook/event/user/register.php' ); |
|
104 | -require_once( $dir . '/hook/event/user/visit.php' ); |
|
105 | -require_once( $dir . '/hook/events.php' ); |
|
106 | -require_once( $dir . '/hook/extension.php' ); |
|
107 | -require_once( $dir . '/hook/extension/blocker.php' ); |
|
108 | -require_once( $dir . '/hook/extension/conditions.php' ); |
|
109 | -require_once( $dir . '/hook/extension/periods.php' ); |
|
110 | -require_once( $dir . '/hook/extension/repeat/blocker.php' ); |
|
111 | -require_once( $dir . '/hook/extension/reversals.php' ); |
|
112 | -require_once( $dir . '/hook/extension/reversals/legacy/points.php' ); |
|
113 | -require_once( $dir . '/hook/fire.php' ); |
|
114 | -require_once( $dir . '/hook/hit/logger.php' ); |
|
115 | -require_once( $dir . '/hook/hit/query.php' ); |
|
116 | -require_once( $dir . '/hook/reaction.php' ); |
|
117 | -require_once( $dir . '/hook/reaction/options.php' ); |
|
118 | -require_once( $dir . '/hook/reaction/store.php' ); |
|
119 | -require_once( $dir . '/hook/reaction/store/options.php' ); |
|
120 | -require_once( $dir . '/hook/reaction/store/options/network.php' ); |
|
121 | -require_once( $dir . '/hook/reaction/validator.php' ); |
|
122 | -require_once( $dir . '/hook/reactor.php' ); |
|
123 | -require_once( $dir . '/hook/reactor/points.php' ); |
|
124 | -require_once( $dir . '/hook/reactor/points/legacy.php' ); |
|
125 | -require_once( $dir . '/hook/retroactive/conditions.php' ); |
|
126 | -require_once( $dir . '/hook/retroactive/query.php' ); |
|
127 | -require_once( $dir . '/hook/retroactive/queryable.php' ); |
|
128 | -require_once( $dir . '/hook/router.php' ); |
|
129 | -require_once( $dir . '/hook/settings.php' ); |
|
130 | -require_once( $dir . '/hook/validator/exception.php' ); |
|
131 | -require_once( $dir . '/hooks.php' ); |
|
132 | -require_once( $dir . '/query/builder/db/mysql.php' ); |
|
133 | -require_once( $dir . '/spec.php' ); |
|
134 | -require_once( $dir . '/wpdb/wrapper.php' ); |
|
13 | +$dir = dirname(__FILE__); |
|
14 | +require_once($dir.'/specedi.php'); |
|
15 | +require_once($dir.'/hook/ui/script/data/provideri.php'); |
|
16 | +require_once($dir.'/hook/settingsi.php'); |
|
17 | +require_once($dir.'/hook/retroactive/queryi.php'); |
|
18 | +require_once($dir.'/hook/retroactive/query/modifieri.php'); |
|
19 | +require_once($dir.'/hook/reactori.php'); |
|
20 | +require_once($dir.'/hook/reactioni.php'); |
|
21 | +require_once($dir.'/hook/reaction/storei.php'); |
|
22 | +require_once($dir.'/hook/extensioni.php'); |
|
23 | +require_once($dir.'/hook/extension/miss/listeneri.php'); |
|
24 | +require_once($dir.'/hook/extension/hit/listeneri.php'); |
|
25 | +require_once($dir.'/hook/eventi.php'); |
|
26 | +require_once($dir.'/hook/event/reversingi.php'); |
|
27 | +require_once($dir.'/hook/conditioni.php'); |
|
28 | +require_once($dir.'/hook/argi.php'); |
|
29 | +require_once($dir.'/hook/actioni.php'); |
|
30 | +require_once($dir.'/entityishi.php'); |
|
31 | +require_once($dir.'/entityish/storedi.php'); |
|
32 | +require_once($dir.'/entity/restricted/visibilityi.php'); |
|
33 | +require_once($dir.'/entity/parenti.php'); |
|
34 | +require_once($dir.'/entity/hierarchyi.php'); |
|
35 | +require_once($dir.'/entity/enumerablei.php'); |
|
36 | +require_once($dir.'/entity/childi.php'); |
|
37 | +require_once($dir.'/data/typei.php'); |
|
38 | +require_once($dir.'/class/registryi.php'); |
|
39 | +require_once($dir.'/class/registry/childreni.php'); |
|
40 | +require_once($dir.'/app.php'); |
|
41 | +require_once($dir.'/app/registry.php'); |
|
42 | +require_once($dir.'/class/autoloader.php'); |
|
43 | +require_once($dir.'/class/registry.php'); |
|
44 | +require_once($dir.'/class/registry/children.php'); |
|
45 | +require_once($dir.'/class/registry/persistent.php'); |
|
46 | +require_once($dir.'/data/type.php'); |
|
47 | +require_once($dir.'/data/type/integer.php'); |
|
48 | +require_once($dir.'/data/type/text.php'); |
|
49 | +require_once($dir.'/db/query.php'); |
|
50 | +require_once($dir.'/entityish.php'); |
|
51 | +require_once($dir.'/entity.php'); |
|
52 | +require_once($dir.'/entity/relationship.php'); |
|
53 | +require_once($dir.'/entity/relationship/dynamic.php'); |
|
54 | +require_once($dir.'/entity/relationship/stored/field.php'); |
|
55 | +require_once($dir.'/entity/stored/array.php'); |
|
56 | +require_once($dir.'/entity/stored/db/table.php'); |
|
57 | +require_once($dir.'/entity/array.php'); |
|
58 | +require_once($dir.'/entity/attr.php'); |
|
59 | +require_once($dir.'/entity/attr/field.php'); |
|
60 | +require_once($dir.'/entity/change.php'); |
|
61 | +require_once($dir.'/entity/comment.php'); |
|
62 | +require_once($dir.'/entity/comment/author.php'); |
|
63 | +require_once($dir.'/entity/comment/post.php'); |
|
64 | +require_once($dir.'/entity/context.php'); |
|
65 | +require_once($dir.'/entity/context/network.php'); |
|
66 | +require_once($dir.'/entity/context/site.php'); |
|
67 | +require_once($dir.'/entity/hierarchy.php'); |
|
68 | +require_once($dir.'/entity/post.php'); |
|
69 | +require_once($dir.'/entity/post/author.php'); |
|
70 | +require_once($dir.'/entity/post/content.php'); |
|
71 | +require_once($dir.'/entity/post/terms.php'); |
|
72 | +require_once($dir.'/entity/post/type.php'); |
|
73 | +require_once($dir.'/entity/post/type/name.php'); |
|
74 | +require_once($dir.'/entity/post/type/relationship.php'); |
|
75 | +require_once($dir.'/entity/site.php'); |
|
76 | +require_once($dir.'/entity/term.php'); |
|
77 | +require_once($dir.'/entity/term/id.php'); |
|
78 | +require_once($dir.'/entity/user.php'); |
|
79 | +require_once($dir.'/entity/user/role.php'); |
|
80 | +require_once($dir.'/entity/user/role/name.php'); |
|
81 | +require_once($dir.'/entity/user/roles.php'); |
|
82 | +require_once($dir.'/hierarchy.php'); |
|
83 | +require_once($dir.'/hook/action.php'); |
|
84 | +require_once($dir.'/hook/action/comment/new.php'); |
|
85 | +require_once($dir.'/hook/action/post/depublish/delete.php'); |
|
86 | +require_once($dir.'/hook/action/post/publish.php'); |
|
87 | +require_once($dir.'/hook/actions.php'); |
|
88 | +require_once($dir.'/hook/arg.php'); |
|
89 | +require_once($dir.'/hook/arg/current/post.php'); |
|
90 | +require_once($dir.'/hook/arg/current/site.php'); |
|
91 | +require_once($dir.'/hook/arg/current/user.php'); |
|
92 | +require_once($dir.'/hook/arg/dynamic.php'); |
|
93 | +require_once($dir.'/hook/condition.php'); |
|
94 | +require_once($dir.'/hook/condition/entity/array/contains.php'); |
|
95 | +require_once($dir.'/hook/condition/equals.php'); |
|
96 | +require_once($dir.'/hook/condition/string/contains.php'); |
|
97 | +require_once($dir.'/hook/event.php'); |
|
98 | +require_once($dir.'/hook/event/dynamic.php'); |
|
99 | +require_once($dir.'/hook/event/args.php'); |
|
100 | +require_once($dir.'/hook/event/comment/leave.php'); |
|
101 | +require_once($dir.'/hook/event/media/upload.php'); |
|
102 | +require_once($dir.'/hook/event/post/publish.php'); |
|
103 | +require_once($dir.'/hook/event/user/register.php'); |
|
104 | +require_once($dir.'/hook/event/user/visit.php'); |
|
105 | +require_once($dir.'/hook/events.php'); |
|
106 | +require_once($dir.'/hook/extension.php'); |
|
107 | +require_once($dir.'/hook/extension/blocker.php'); |
|
108 | +require_once($dir.'/hook/extension/conditions.php'); |
|
109 | +require_once($dir.'/hook/extension/periods.php'); |
|
110 | +require_once($dir.'/hook/extension/repeat/blocker.php'); |
|
111 | +require_once($dir.'/hook/extension/reversals.php'); |
|
112 | +require_once($dir.'/hook/extension/reversals/legacy/points.php'); |
|
113 | +require_once($dir.'/hook/fire.php'); |
|
114 | +require_once($dir.'/hook/hit/logger.php'); |
|
115 | +require_once($dir.'/hook/hit/query.php'); |
|
116 | +require_once($dir.'/hook/reaction.php'); |
|
117 | +require_once($dir.'/hook/reaction/options.php'); |
|
118 | +require_once($dir.'/hook/reaction/store.php'); |
|
119 | +require_once($dir.'/hook/reaction/store/options.php'); |
|
120 | +require_once($dir.'/hook/reaction/store/options/network.php'); |
|
121 | +require_once($dir.'/hook/reaction/validator.php'); |
|
122 | +require_once($dir.'/hook/reactor.php'); |
|
123 | +require_once($dir.'/hook/reactor/points.php'); |
|
124 | +require_once($dir.'/hook/reactor/points/legacy.php'); |
|
125 | +require_once($dir.'/hook/retroactive/conditions.php'); |
|
126 | +require_once($dir.'/hook/retroactive/query.php'); |
|
127 | +require_once($dir.'/hook/retroactive/queryable.php'); |
|
128 | +require_once($dir.'/hook/router.php'); |
|
129 | +require_once($dir.'/hook/settings.php'); |
|
130 | +require_once($dir.'/hook/validator/exception.php'); |
|
131 | +require_once($dir.'/hooks.php'); |
|
132 | +require_once($dir.'/query/builder/db/mysql.php'); |
|
133 | +require_once($dir.'/spec.php'); |
|
134 | +require_once($dir.'/wpdb/wrapper.php'); |
|
135 | 135 | // } |
136 | 136 | |
137 | 137 | // EOF |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | protected function init() { |
41 | 41 | |
42 | 42 | $sub_apps = $this->sub_apps; |
43 | - $sub_apps->register( 'router', 'WordPoints_Hook_Router' ); |
|
44 | - $sub_apps->register( 'actions', 'WordPoints_Hook_Actions' ); |
|
45 | - $sub_apps->register( 'events', 'WordPoints_Hook_Events' ); |
|
46 | - $sub_apps->register( 'reactors', 'WordPoints_Class_Registry_Persistent' ); |
|
47 | - $sub_apps->register( 'reaction_stores', 'WordPoints_Class_Registry_Children' ); |
|
48 | - $sub_apps->register( 'extensions', 'WordPoints_Class_Registry_Persistent' ); |
|
49 | - $sub_apps->register( 'conditions', 'WordPoints_Class_Registry_Children' ); |
|
43 | + $sub_apps->register('router', 'WordPoints_Hook_Router'); |
|
44 | + $sub_apps->register('actions', 'WordPoints_Hook_Actions'); |
|
45 | + $sub_apps->register('events', 'WordPoints_Hook_Events'); |
|
46 | + $sub_apps->register('reactors', 'WordPoints_Class_Registry_Persistent'); |
|
47 | + $sub_apps->register('reaction_stores', 'WordPoints_Class_Registry_Children'); |
|
48 | + $sub_apps->register('extensions', 'WordPoints_Class_Registry_Persistent'); |
|
49 | + $sub_apps->register('conditions', 'WordPoints_Class_Registry_Children'); |
|
50 | 50 | |
51 | 51 | parent::init(); |
52 | 52 | } |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function get_current_mode() { |
71 | 71 | |
72 | - if ( ! isset( $this->current_mode ) ) { |
|
73 | - $this->current_mode = ( wordpoints_is_network_context() ? 'network' : 'standard' ); |
|
72 | + if ( ! isset($this->current_mode)) { |
|
73 | + $this->current_mode = (wordpoints_is_network_context() ? 'network' : 'standard'); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | return $this->current_mode; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @param string $mode The slug of the mode to set as the current mode. |
90 | 90 | */ |
91 | - public function set_current_mode( $mode ) { |
|
91 | + public function set_current_mode($mode) { |
|
92 | 92 | $this->current_mode = $mode; |
93 | 93 | } |
94 | 94 | |
@@ -101,19 +101,19 @@ discard block |
||
101 | 101 | * |
102 | 102 | * @return WordPoints_Hook_Reaction_StoreI|false The reaction storage object. |
103 | 103 | */ |
104 | - public function get_reaction_store( $slug ) { |
|
104 | + public function get_reaction_store($slug) { |
|
105 | 105 | |
106 | - $reaction_store = $this->get_sub_app( 'reaction_stores' )->get( |
|
106 | + $reaction_store = $this->get_sub_app('reaction_stores')->get( |
|
107 | 107 | $this->get_current_mode() |
108 | 108 | , $slug |
109 | 109 | ); |
110 | 110 | |
111 | - if ( ! $reaction_store instanceof WordPoints_Hook_Reaction_StoreI ) { |
|
111 | + if ( ! $reaction_store instanceof WordPoints_Hook_Reaction_StoreI) { |
|
112 | 112 | return false; |
113 | 113 | } |
114 | 114 | |
115 | 115 | // Allowing access to stores out-of-context would lead to strange behavior. |
116 | - if ( false === $reaction_store->get_context_id() ) { |
|
116 | + if (false === $reaction_store->get_context_id()) { |
|
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | |
@@ -136,19 +136,19 @@ discard block |
||
136 | 136 | $action_type |
137 | 137 | ) { |
138 | 138 | |
139 | - foreach ( $this->get_sub_app( 'reaction_stores' )->get_all() as $reaction_stores ) { |
|
140 | - foreach ( $reaction_stores as $reaction_store ) { |
|
139 | + foreach ($this->get_sub_app('reaction_stores')->get_all() as $reaction_stores) { |
|
140 | + foreach ($reaction_stores as $reaction_store) { |
|
141 | 141 | |
142 | - if ( ! $reaction_store instanceof WordPoints_Hook_Reaction_StoreI ) { |
|
142 | + if ( ! $reaction_store instanceof WordPoints_Hook_Reaction_StoreI) { |
|
143 | 143 | continue; |
144 | 144 | } |
145 | 145 | |
146 | 146 | // Allowing access to stores out-of-context would lead to strange behavior. |
147 | - if ( false === $reaction_store->get_context_id() ) { |
|
147 | + if (false === $reaction_store->get_context_id()) { |
|
148 | 148 | continue; |
149 | 149 | } |
150 | 150 | |
151 | - foreach ( $reaction_store->get_reactions_to_event( $event_slug ) as $reaction ) { |
|
151 | + foreach ($reaction_store->get_reactions_to_event($event_slug) as $reaction) { |
|
152 | 152 | |
153 | 153 | $fire = new WordPoints_Hook_Fire( |
154 | 154 | $event_args |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | , $action_type |
157 | 157 | ); |
158 | 158 | |
159 | - $this->fire_reaction( $fire ); |
|
159 | + $this->fire_reaction($fire); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | } |
@@ -169,32 +169,32 @@ discard block |
||
169 | 169 | * |
170 | 170 | * @param WordPoints_Hook_Fire $fire The hook fire object. |
171 | 171 | */ |
172 | - protected function fire_reaction( $fire ) { |
|
172 | + protected function fire_reaction($fire) { |
|
173 | 173 | |
174 | 174 | /** @var WordPoints_Hook_ReactorI $reactor */ |
175 | - $reactor = $this->get_sub_app( 'reactors' )->get( $fire->reaction->get_reactor_slug() ); |
|
175 | + $reactor = $this->get_sub_app('reactors')->get($fire->reaction->get_reactor_slug()); |
|
176 | 176 | |
177 | - if ( ! in_array( $fire->action_type, $reactor->get_action_types(), true ) ) { |
|
177 | + if ( ! in_array($fire->action_type, $reactor->get_action_types(), true)) { |
|
178 | 178 | return; |
179 | 179 | } |
180 | 180 | |
181 | - $validator = new WordPoints_Hook_Reaction_Validator( $fire->reaction, true ); |
|
181 | + $validator = new WordPoints_Hook_Reaction_Validator($fire->reaction, true); |
|
182 | 182 | $validator->validate(); |
183 | 183 | |
184 | - if ( $validator->had_errors() ) { |
|
184 | + if ($validator->had_errors()) { |
|
185 | 185 | return; |
186 | 186 | } |
187 | 187 | |
188 | - unset( $validator ); |
|
188 | + unset($validator); |
|
189 | 189 | |
190 | 190 | /** @var WordPoints_Hook_ExtensionI[] $extensions */ |
191 | - $extensions = $this->get_sub_app( 'extensions' )->get_all(); |
|
191 | + $extensions = $this->get_sub_app('extensions')->get_all(); |
|
192 | 192 | |
193 | - foreach ( $extensions as $extension ) { |
|
194 | - if ( ! $extension->should_hit( $fire ) ) { |
|
195 | - foreach ( $extensions as $ext ) { |
|
196 | - if ( $ext instanceof WordPoints_Hook_Extension_Miss_ListenerI ) { |
|
197 | - $ext->after_miss( $fire ); |
|
193 | + foreach ($extensions as $extension) { |
|
194 | + if ( ! $extension->should_hit($fire)) { |
|
195 | + foreach ($extensions as $ext) { |
|
196 | + if ($ext instanceof WordPoints_Hook_Extension_Miss_ListenerI) { |
|
197 | + $ext->after_miss($fire); |
|
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
@@ -204,11 +204,11 @@ discard block |
||
204 | 204 | |
205 | 205 | $fire->hit(); |
206 | 206 | |
207 | - $reactor->hit( $fire ); |
|
207 | + $reactor->hit($fire); |
|
208 | 208 | |
209 | - foreach ( $extensions as $extension ) { |
|
210 | - if ( $extension instanceof WordPoints_Hook_Extension_Hit_ListenerI ) { |
|
211 | - $extension->after_hit( $fire ); |
|
209 | + foreach ($extensions as $extension) { |
|
210 | + if ($extension instanceof WordPoints_Hook_Extension_Hit_ListenerI) { |
|
211 | + $extension->after_hit($fire); |
|
212 | 212 | } |
213 | 213 | } |
214 | 214 | } |
@@ -94,16 +94,16 @@ discard block |
||
94 | 94 | /** |
95 | 95 | * @since 1.0.0 |
96 | 96 | */ |
97 | - public function __construct( $slug, $parent = null ) { |
|
97 | + public function __construct($slug, $parent = null) { |
|
98 | 98 | |
99 | 99 | $this->slug = $slug; |
100 | 100 | $this->full_slug = $slug; |
101 | 101 | |
102 | - if ( $parent instanceof WordPoints_App ) { |
|
102 | + if ($parent instanceof WordPoints_App) { |
|
103 | 103 | $this->parent = $parent; |
104 | 104 | |
105 | - if ( 'apps' !== $this->parent->full_slug ) { |
|
106 | - $this->full_slug = $this->parent->full_slug . '-' . $this->full_slug; |
|
105 | + if ('apps' !== $this->parent->full_slug) { |
|
106 | + $this->full_slug = $this->parent->full_slug.'-'.$this->full_slug; |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
@@ -121,21 +121,21 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @return null|object|WordPoints_App|WordPoints_Class_RegistryI|WordPoints_Class_Registry_ChildrenI The sub app, or null if not found. |
123 | 123 | */ |
124 | - public function get_sub_app( $slug ) { |
|
124 | + public function get_sub_app($slug) { |
|
125 | 125 | |
126 | - $sub_app = $this->sub_apps->get( $slug, array( $this ) ); |
|
126 | + $sub_app = $this->sub_apps->get($slug, array($this)); |
|
127 | 127 | |
128 | - if ( ! $sub_app ) { |
|
128 | + if ( ! $sub_app) { |
|
129 | 129 | return null; |
130 | 130 | } |
131 | 131 | |
132 | 132 | if ( |
133 | - empty( $this->did_init[ $slug ] ) |
|
133 | + empty($this->did_init[$slug]) |
|
134 | 134 | && ! self::$main->silent |
135 | - && $this->should_do_registry_init( $sub_app ) |
|
135 | + && $this->should_do_registry_init($sub_app) |
|
136 | 136 | ) { |
137 | 137 | |
138 | - $this->did_init[ $slug ] = true; |
|
138 | + $this->did_init[$slug] = true; |
|
139 | 139 | |
140 | 140 | /** |
141 | 141 | * Initialization of an app registry. |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @param WordPoints_Class_RegistryI|WordPoints_Class_Registry_ChildrenI |
148 | 148 | * $registry The registry object. |
149 | 149 | */ |
150 | - do_action( "wordpoints_init_app_registry-{$this->full_slug}-{$slug}", $sub_app ); |
|
150 | + do_action("wordpoints_init_app_registry-{$this->full_slug}-{$slug}", $sub_app); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | return $sub_app; |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * |
174 | 174 | * @return bool Whether to call the init action or not. |
175 | 175 | */ |
176 | - protected function should_do_registry_init( $registry ) { |
|
176 | + protected function should_do_registry_init($registry) { |
|
177 | 177 | return ( |
178 | 178 | $registry instanceof WordPoints_Class_RegistryI |
179 | 179 | || $registry instanceof WordPoints_Class_Registry_ChildrenI |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * |
198 | 198 | * @param WordPoints_App $app The app object. |
199 | 199 | */ |
200 | - do_action( "wordpoints_init_app-{$this->full_slug}", $this ); |
|
200 | + do_action("wordpoints_init_app-{$this->full_slug}", $this); |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | * @param int $id The ID of a hook reaction. |
41 | 41 | * @param WordPoints_Hook_Reaction_StoreI $store The storage object. |
42 | 42 | */ |
43 | - public function __construct( $id, WordPoints_Hook_Reaction_StoreI $store ) { |
|
43 | + public function __construct($id, WordPoints_Hook_Reaction_StoreI $store) { |
|
44 | 44 | |
45 | - $this->ID = wordpoints_int( $id ); |
|
45 | + $this->ID = wordpoints_int($id); |
|
46 | 46 | $this->store = $store; |
47 | 47 | } |
48 | 48 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @since 1.0.0 |
70 | 70 | */ |
71 | 71 | public function get_reactor_slug() { |
72 | - return $this->get_meta( 'reactor' ); |
|
72 | + return $this->get_meta('reactor'); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |