1 | <?php |
||
23 | class RecursiveMembersIterator implements RecursiveIterator { |
||
24 | |||
25 | /** |
||
26 | * @var Store |
||
27 | */ |
||
28 | private $store; |
||
29 | |||
30 | /** |
||
31 | * @var array $primaryKey The name of the primary key(s) |
||
32 | */ |
||
33 | protected $groups; |
||
34 | |||
35 | /** |
||
36 | * @var array $current The current iterator value |
||
37 | */ |
||
38 | private $current = []; |
||
39 | |||
40 | /** |
||
41 | * @var integer key 0-indexed number of pages fetched since self::reset() |
||
42 | */ |
||
43 | private $key; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | private $agentName = ''; |
||
49 | |||
50 | /** |
||
51 | * @var boolean |
||
52 | */ |
||
53 | private $notifyAgent = false; |
||
54 | |||
55 | /** |
||
56 | * @var DIWikiPage|null |
||
57 | */ |
||
58 | private $subject = null; |
||
59 | |||
60 | /** |
||
61 | * @var false |
||
62 | */ |
||
63 | private $notificationsTo = false; |
||
64 | |||
65 | /** |
||
66 | * @since 1.0 |
||
67 | * |
||
68 | * @param Iterator|array $groups |
||
69 | * @param Store $store |
||
70 | */ |
||
71 | 12 | public function __construct( $groups, Store $store ) { |
|
75 | |||
76 | /** |
||
77 | * @since 1.0 |
||
78 | * |
||
79 | * @param string $agentName |
||
80 | */ |
||
81 | 4 | public function setAgentName( $agentName ) { |
|
84 | |||
85 | /** |
||
86 | * @since 1.0 |
||
87 | * |
||
88 | * @param boolean $notifyAgent |
||
89 | */ |
||
90 | 2 | public function notifyAgent( $notifyAgent ) { |
|
93 | |||
94 | /** |
||
95 | * @since 1.0 |
||
96 | * |
||
97 | * @param DIWikiPage|null $subject |
||
98 | */ |
||
99 | 4 | public function setSubject( DIWikiPage $subject = null ) { |
|
102 | |||
103 | /** |
||
104 | * @since 1.0 |
||
105 | * |
||
106 | * @return array The most recently fetched set of rows from the database |
||
107 | */ |
||
108 | 10 | public function current() { |
|
111 | |||
112 | /** |
||
113 | * @since 1.0 |
||
114 | * |
||
115 | * @return integer 0-indexed count of the page number fetched |
||
116 | */ |
||
117 | public function key() { |
||
120 | |||
121 | /** |
||
122 | * @since 1.0 |
||
123 | * |
||
124 | * Reset the iterator to the beginning of the table. |
||
125 | */ |
||
126 | 4 | public function rewind() { |
|
131 | |||
132 | /** |
||
133 | * @since 1.0 |
||
134 | * |
||
135 | * @return bool True when the iterator is in a valid state |
||
136 | */ |
||
137 | 4 | public function valid() { |
|
140 | |||
141 | /** |
||
142 | * @since 1.0 |
||
143 | * |
||
144 | * @return bool True when this result set has rows |
||
145 | */ |
||
146 | public function hasChildren() { |
||
149 | |||
150 | /** |
||
151 | * @since 1.0 |
||
152 | * |
||
153 | * @return RecursiveIterator |
||
154 | */ |
||
155 | public function getChildren() { |
||
158 | |||
159 | /** |
||
160 | * Fetch the next set of rows from the database. |
||
161 | * |
||
162 | * @since 1.0 |
||
163 | * |
||
164 | * {@inheritDoc} |
||
165 | */ |
||
166 | 11 | public function next() { |
|
199 | |||
200 | 11 | private function doFilterMembersByNotificationsToAssignment( $subject ) { |
|
218 | |||
219 | 10 | private function doFilterMembers( $members, &$recipients, $groupName = null ) { |
|
237 | |||
238 | 4 | private function initGroups() { |
|
250 | |||
251 | } |
||
252 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.