Completed
Push — master ( faeb69...3d46b5 )
by J.D.
02:57
created

WordPoints_Hook_Reaction::get_context_id()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Hook reaction class.
5
 *
6
 * @package wordpoints-hooks-api
7
 * @since 1.0.0
8
 */
9
10
/**
11
 * Bootstrap for representing a hook reaction.
12
 *
13
 * @since 1.0.0
14
 */
15
abstract class WordPoints_Hook_Reaction implements WordPoints_Hook_ReactionI {
16
17
	/**
18
	 * @since 1.0.0
19
	 */
20
	protected $ID;
21
22
	/**
23
	 * The reaction storage object.
24
	 *
25
	 * @since 1.0.0
26
	 *
27
	 * @var WordPoints_Hook_Reaction_StorageI
28
	 */
29
	protected $storage;
30
31
	//
32
	// Public Methods.
33
	//
34
35
	/**
36
	 * @since 1.0.0
37
	 */
38
	public function __construct( $id, WordPoints_Hook_Reaction_StorageI $storage ) {
39
40
		$this->ID      = wordpoints_int( $id );
41
		$this->storage = $storage;
42
	}
43
44
	/**
45
	 * @since 1.0.0
46
	 */
47
	public function __get( $var ) {
48
49
		if ( 'ID' === $var ) {
50
			return $this->ID;
51
		}
52
53
		return null;
54
	}
55
56
	/**
57
	 * @since 1.0.0
58
	 */
59
	public function get_reactor_slug() {
60
		return $this->storage->get_reactor_slug();
61
	}
62
63
	/**
64
	 * @since 1.0.0
65
	 */
66
	public function get_storage_group_slug() {
67
		return $this->storage->get_slug();
68
	}
69
70
	/**
71
	 * @since 1.0.0
72
	 */
73
	public function get_context_id() {
74
		return $this->storage->get_context_id();
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->storage->get_context_id(); of type array|false adds the type array to the return on line 74 which is incompatible with the return type declared by the interface WordPoints_Hook_ReactionI::get_context_id of type boolean.
Loading history...
75
	}
76
}
77
78
// EOF
79