| @@ 165-182 (lines=18) @@ | ||
| 162 | * |
|
| 163 | * @return Auth\Group|Auth\User|false The merged returnValue |
|
| 164 | */ |
|
| 165 | private function callOnEach($functionName, $args, $checkField = false, $checkValue = false) |
|
| 166 | { |
|
| 167 | $ret = false; |
|
| 168 | $count = count($this->methods); |
|
| 169 | for($i = 0; $i < $count; $i++) |
|
| 170 | { |
|
| 171 | if($checkField !== false) |
|
| 172 | { |
|
| 173 | if($this->methods[$i]->{$checkField} === $checkValue) |
|
| 174 | { |
|
| 175 | continue; |
|
| 176 | } |
|
| 177 | } |
|
| 178 | $res = call_user_func_array(array($this->methods[$i], $functionName), $args); |
|
| 179 | $this->mergeResult($ret, $res); |
|
| 180 | } |
|
| 181 | return $ret; |
|
| 182 | } |
|
| 183 | ||
| 184 | /** |
|
| 185 | * Calls the indicated function on each Authenticator and add the result |
|
| @@ 193-210 (lines=18) @@ | ||
| 190 | * |
|
| 191 | * @return integer The added returnValue |
|
| 192 | */ |
|
| 193 | private function addFromEach($functionName, $checkField = false, $checkValue = false) |
|
| 194 | { |
|
| 195 | $retCount = 0; |
|
| 196 | $count = count($this->methods); |
|
| 197 | for($i = 0; $i < $count; $i++) |
|
| 198 | { |
|
| 199 | if($checkField !== false) |
|
| 200 | { |
|
| 201 | if($this->methods[$i]->{$checkField} === $checkValue) |
|
| 202 | { |
|
| 203 | continue; |
|
| 204 | } |
|
| 205 | } |
|
| 206 | $res = call_user_func(array($this->methods[$i], $functionName)); |
|
| 207 | $retCount += $res; |
|
| 208 | } |
|
| 209 | return $retCount; |
|
| 210 | } |
|
| 211 | ||
| 212 | /** |
|
| 213 | * Get an Auth\Group by its name |
|