@@ 188-205 (lines=18) @@ | ||
185 | * |
|
186 | * @return Auth\Group|Auth\User|false The merged returnValue |
|
187 | */ |
|
188 | private function callOnEach($functionName, $args, $checkField = false, $checkValue = false) |
|
189 | { |
|
190 | $ret = false; |
|
191 | $count = count($this->methods); |
|
192 | for($i = 0; $i < $count; $i++) |
|
193 | { |
|
194 | if($checkField) |
|
195 | { |
|
196 | if($this->methods[$i]->{$checkField} === $checkValue) |
|
197 | { |
|
198 | continue; |
|
199 | } |
|
200 | } |
|
201 | $res = call_user_func_array(array($this->methods[$i], $functionName), $args); |
|
202 | $this->mergeResult($ret, $res); |
|
203 | } |
|
204 | return $ret; |
|
205 | } |
|
206 | ||
207 | /** |
|
208 | * Calls the indicated function on each Authenticator and add the result |
|
@@ 216-233 (lines=18) @@ | ||
213 | * |
|
214 | * @return integer The added returnValue |
|
215 | */ |
|
216 | private function addFromEach($functionName, $checkField = false, $checkValue = false) |
|
217 | { |
|
218 | $retCount = 0; |
|
219 | $count = count($this->methods); |
|
220 | for($i = 0; $i < $count; $i++) |
|
221 | { |
|
222 | if($checkField) |
|
223 | { |
|
224 | if($this->methods[$i]->{$checkField} === $checkValue) |
|
225 | { |
|
226 | continue; |
|
227 | } |
|
228 | } |
|
229 | $res = call_user_func(array($this->methods[$i], $functionName)); |
|
230 | $retCount += $res; |
|
231 | } |
|
232 | return $retCount; |
|
233 | } |
|
234 | ||
235 | /** |
|
236 | * Get an Auth\Group by its name |