Code Duplication    Length = 21-24 lines in 2 locations

src/includes/classes/hook/reactor.php 2 locations

@@ 171-194 (lines=24) @@
168
	 *
169
	 * @return WordPoints_Hook_ReactionI[] All of the reaction objects.
170
	 */
171
	public function get_all_reactions_to_event( $event_slug ) {
172
173
		$reactions = array();
174
175
		$slugs = wordpoints_hooks()->reaction_groups->get_children_slugs(
176
			$this->slug
177
		);
178
179
		foreach ( $slugs as $slug ) {
180
181
			$storage = $this->get_reaction_group( $slug );
182
183
			if ( ! $storage ) {
184
				continue;
185
			}
186
187
			$reactions = array_merge(
188
				$reactions
189
				, $storage->get_reactions_to_event( $event_slug )
190
			);
191
		}
192
193
		return $reactions;
194
	}
195
196
	/**
197
	 * Get all reactions for this reactor.
@@ 210-230 (lines=21) @@
207
	 *
208
	 * @return WordPoints_Hook_ReactionI[] All of the reaction objects.
209
	 */
210
	public function get_all_reactions() {
211
212
		$reactions = array();
213
214
		$slugs = wordpoints_hooks()->reaction_groups->get_children_slugs(
215
			$this->slug
216
		);
217
218
		foreach ( $slugs as $slug ) {
219
220
			$storage = $this->get_reaction_group( $slug );
221
222
			if ( ! $storage ) {
223
				continue;
224
			}
225
226
			$reactions = array_merge( $reactions, $storage->get_reactions() );
227
		}
228
229
		return $reactions;
230
	}
231
232
	/**
233
	 * @since 1.0.0