1 | <?php |
||
18 | class TargetCollection implements TargetInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var Target[] |
||
22 | */ |
||
23 | protected $targets; |
||
24 | |||
25 | protected $ids; |
||
26 | |||
27 | protected $types; |
||
28 | |||
29 | 3 | public function __construct(array $targets) |
|
41 | |||
42 | public function add(TargetInterface $target) |
||
50 | |||
51 | /** |
||
52 | * @return int |
||
53 | */ |
||
54 | 1 | public function getId() |
|
58 | |||
59 | /** |
||
60 | * @return bool |
||
61 | */ |
||
62 | public function hasId() |
||
66 | |||
67 | public function getIds() |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | 1 | public function getType() |
|
79 | |||
80 | public function getTypes() |
||
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | public function getName() |
||
92 | |||
93 | 1 | public function getTarget() |
|
97 | |||
98 | 1 | public function getTargets() |
|
102 | |||
103 | /** |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getUniqueId() |
||
110 | |||
111 | /** |
||
112 | * @return bool |
||
113 | */ |
||
114 | 1 | public function matches(TargetInterface $other): bool |
|
118 | |||
119 | 1 | public function checkMatches(TargetInterface $other): bool |
|
129 | |||
130 | public static function takeIds(TargetInterface $other) |
||
134 | |||
135 | public static function takeTypes(TargetInterface $other) |
||
139 | |||
140 | public function jsonSerialize() |
||
144 | } |
||
145 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: