1 | <?php |
||
14 | abstract class SubscribableObject extends ApiObject |
||
15 | { |
||
16 | /** |
||
17 | * The objects's unique identifier. |
||
18 | * |
||
19 | * @var int |
||
20 | */ |
||
21 | protected $id; |
||
22 | |||
23 | /** |
||
24 | * @var PulseUser[] |
||
25 | */ |
||
26 | protected $subscribers; |
||
27 | |||
28 | /** |
||
29 | * The objects's unique identifier. |
||
30 | * |
||
31 | * @return int |
||
32 | */ |
||
33 | 25 | public function getId () |
|
37 | |||
38 | /** |
||
39 | * Get the users who are subscribed to this object |
||
40 | * |
||
41 | * @api |
||
42 | * |
||
43 | * @param array $params |
||
44 | * @param bool $forceFetch When set to true, this will force an API call to retrieve the subscribers. Otherwise, |
||
45 | * this'll return the cached subscribers. |
||
46 | * |
||
47 | * @since 0.1.0 |
||
48 | * |
||
49 | * @return PulseUser[] |
||
50 | */ |
||
51 | public function getSubscribers ($params = array(), $forceFetch = false) |
||
63 | |||
64 | /** |
||
65 | * Subscriber a user to a object |
||
66 | * |
||
67 | * @api |
||
68 | * |
||
69 | * @param int|PulseUser $userId The user that will be subscribed to the board |
||
70 | * @param bool|null $asAdmin Set to true if the user will be an admin of the board |
||
71 | * |
||
72 | * @since 0.1.0 |
||
73 | */ |
||
74 | public function addSubscriber ($userId, $asAdmin = NULL) |
||
97 | |||
98 | /** |
||
99 | * Unsubscribe a user from this object |
||
100 | * |
||
101 | * @api |
||
102 | * |
||
103 | * @param int|PulseUser $userId The user that will be unsubscribed from the board |
||
104 | * |
||
105 | * @since 0.1.0 |
||
106 | */ |
||
107 | public function removeSubscriber ($userId) |
||
132 | } |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.