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