@@ 145-162 (lines=18) @@ | ||
142 | * |
|
143 | * @return Auth\Group|Auth\User|false The merged returnValue |
|
144 | */ |
|
145 | private function callOnEach($functionName, $args, $checkField = false, $checkValue = false) |
|
146 | { |
|
147 | $ret = false; |
|
148 | $count = count($this->methods); |
|
149 | for($i = 0; $i < $count; $i++) |
|
150 | { |
|
151 | if($checkField !== false) |
|
152 | { |
|
153 | if($this->methods[$i]->{$checkField} === $checkValue) |
|
154 | { |
|
155 | continue; |
|
156 | } |
|
157 | } |
|
158 | $res = call_user_func_array(array($this->methods[$i], $functionName), $args); |
|
159 | $this->mergeResult($ret, $res); |
|
160 | } |
|
161 | return $ret; |
|
162 | } |
|
163 | ||
164 | /** |
|
165 | * Calls the indicated function on each Authenticator and add the result |
|
@@ 173-190 (lines=18) @@ | ||
170 | * |
|
171 | * @return integer The added returnValue |
|
172 | */ |
|
173 | private function addFromEach($functionName, $checkField = false, $checkValue = false) |
|
174 | { |
|
175 | $retCount = 0; |
|
176 | $count = count($this->methods); |
|
177 | for($i = 0; $i < $count; $i++) |
|
178 | { |
|
179 | if($checkField !== false) |
|
180 | { |
|
181 | if($this->methods[$i]->{$checkField} === $checkValue) |
|
182 | { |
|
183 | continue; |
|
184 | } |
|
185 | } |
|
186 | $res = call_user_func(array($this->methods[$i], $functionName)); |
|
187 | $retCount += $res; |
|
188 | } |
|
189 | return $retCount; |
|
190 | } |
|
191 | ||
192 | /** |
|
193 | * Get an Auth\Group by its name |