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 | public function getIds() |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | 1 | public function getType() |
|
71 | |||
72 | public function getTypes() |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function getName() |
||
84 | |||
85 | 1 | public function getTarget() |
|
89 | |||
90 | 1 | public function getTargets() |
|
94 | |||
95 | /** |
||
96 | * @return string |
||
97 | */ |
||
98 | public function getUniqueId() |
||
102 | |||
103 | /** |
||
104 | * @return bool |
||
105 | */ |
||
106 | 1 | public function matches(TargetInterface $other): bool |
|
110 | |||
111 | 1 | public function checkMatches(TargetInterface $other): bool |
|
121 | |||
122 | public static function takeIds(TargetInterface $other) |
||
126 | |||
127 | public static function takeTypes(TargetInterface $other) |
||
131 | |||
132 | public function jsonSerialize() |
||
136 | } |
||
137 |
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: