Code Duplication    Length = 17-20 lines in 2 locations

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

@@ 201-220 (lines=20) @@
198
	 *
199
	 * @return WordPoints_Hook_ReactionI[] All of the reaction objects.
200
	 */
201
	public function get_all_reactions_to_event( $event_slug ) {
202
203
		$reactions = array();
204
205
		foreach ( array( 'standard', 'network' ) as $store ) {
206
207
			$storage = $this->{"{$store}_reactions"};
208
209
			if ( ! $storage instanceof WordPoints_Hook_Reaction_StorageI ) {
210
				continue;
211
			}
212
213
			$reactions = array_merge(
214
				$reactions
215
				, $storage->get_reactions_to_event( $event_slug )
216
			);
217
		}
218
219
		return $reactions;
220
	}
221
222
	/**
223
	 * Get all reactions for this reactor.
@@ 233-249 (lines=17) @@
230
	 *
231
	 * @return WordPoints_Hook_ReactionI[] All of the reaction objects.
232
	 */
233
	public function get_all_reactions() {
234
235
		$reactions = array();
236
237
		foreach ( array( 'standard', 'network' ) as $store ) {
238
239
			$storage = $this->{"{$store}_reactions"};
240
241
			if ( ! $storage instanceof WordPoints_Hook_Reaction_StorageI ) {
242
				continue;
243
			}
244
245
			$reactions = array_merge( $reactions, $storage->get_reactions() );
246
		}
247
248
		return $reactions;
249
	}
250
251
	/**
252
	 * @since 1.0.0