1 | <?php |
||
18 | abstract class WordPoints_Hook_Reaction_Store implements WordPoints_Hook_Reaction_StoreI { |
||
19 | |||
20 | /** |
||
21 | * The slug of this store. |
||
22 | * |
||
23 | * @since 1.0.0 |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $slug; |
||
28 | |||
29 | /** |
||
30 | * The reactor that these reactions belong to. |
||
31 | * |
||
32 | * @since 1.0.0 |
||
33 | * |
||
34 | * @var WordPoints_Hook_Reactor |
||
35 | */ |
||
36 | protected $reactor; |
||
37 | |||
38 | /** |
||
39 | * The slug of the contexts in which the reactions are stored. |
||
40 | * |
||
41 | * @since 1.0.0 |
||
42 | * |
||
43 | * @see wordpoints_entities_get_current_context_id() |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $context = 'site'; |
||
48 | |||
49 | /** |
||
50 | * The name of the class to use for reaction objects. |
||
51 | * |
||
52 | * The class must implement the WordPoints_Hook_ReactionI interface. |
||
53 | * |
||
54 | * @since 1.0.0 |
||
55 | * |
||
56 | * @var string |
||
57 | */ |
||
58 | protected $reaction_class; |
||
59 | |||
60 | /** |
||
61 | * @since 1.0.0 |
||
62 | */ |
||
63 | public function __construct( $slug, WordPoints_Hook_Reactor $reactor ) { |
||
68 | |||
69 | /** |
||
70 | * @since 1.0.0 |
||
71 | */ |
||
72 | public function get_slug() { |
||
75 | |||
76 | /** |
||
77 | * @since 1.0.0 |
||
78 | */ |
||
79 | public function get_reactor_slug() { |
||
82 | |||
83 | /** |
||
84 | * @since 1.0.0 |
||
85 | */ |
||
86 | public function get_context_id() { |
||
89 | |||
90 | /** |
||
91 | * @since 1.0.0 |
||
92 | */ |
||
93 | public function get_reaction( $id ) { |
||
101 | |||
102 | /** |
||
103 | * @since 1.0.0 |
||
104 | */ |
||
105 | public function create_reaction( array $settings ) { |
||
108 | |||
109 | /** |
||
110 | * @since 1.0.0 |
||
111 | */ |
||
112 | public function update_reaction( $id, array $settings ) { |
||
115 | |||
116 | /** |
||
117 | * Create or update a reaction. |
||
118 | * |
||
119 | * @since 1.0.0 |
||
120 | * |
||
121 | * @param array $settings The settings for the reaction. |
||
122 | * @param int $id The ID of the reaction to update, if updating. |
||
123 | * |
||
124 | * @return WordPoints_Hook_ReactionI|false|WordPoints_Hook_Reaction_Validator |
||
125 | * The reaction object if created/updated successfully. False or a |
||
126 | * validator instance if not. |
||
127 | */ |
||
128 | protected function create_or_update_reaction( array $settings, $id = null ) { |
||
176 | |||
177 | /** |
||
178 | * Create a reaction. |
||
179 | * |
||
180 | * The event slug is provided in case it is needed (for some storage methods it |
||
181 | * is). |
||
182 | * |
||
183 | * @since 1.0.0 |
||
184 | * |
||
185 | * @param string $event_slug The slug of the event this reaction is for. |
||
186 | * |
||
187 | * @return int|false The reaction ID, or false if not created. |
||
188 | */ |
||
189 | abstract protected function _create_reaction( $event_slug ); |
||
190 | } |
||
191 | |||
193 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: