1 | <?php |
||
3 | class Provider extends Singleton |
||
4 | { |
||
5 | /** The methods loaded by the provider */ |
||
6 | protected $methods; |
||
7 | |||
8 | /** |
||
9 | * Get the method object corresponding to the name |
||
10 | * |
||
11 | * @param string $methodName The class name of the method to get the instance for |
||
12 | * |
||
13 | * @return boolean|stdClass The specified method class instance or false if it is not loaded |
||
14 | */ |
||
15 | public function getMethodByName($methodName) |
||
27 | |||
28 | /** |
||
29 | * Calls the indicated function on each method and add the result |
||
30 | * |
||
31 | * @param string $functionName The function to call |
||
32 | * @param string $checkField A field to check if it is set a certain way before calling the function |
||
33 | * @param mixed $checkValue The value that field should be set to to not call the function |
||
34 | * |
||
35 | * @return integer The added returnValue |
||
36 | */ |
||
37 | protected function addFromEach($functionName, $checkField = false, $checkValue = false) |
||
55 | |||
56 | /** |
||
57 | * Calls the indicated function on each method |
||
58 | * |
||
59 | * @param string $functionName The function to call |
||
60 | * @param array $args The arguments for the function |
||
61 | * @param boolean|string $checkField A field to check if it is set a certain way before calling the function |
||
62 | * @param mixed $checkValue The value that field should be set to to not call the function |
||
63 | * @param callable $resFunction Function to call on the result, otherwise the function will return on the first non-false result |
||
64 | * |
||
65 | * @return Auth\Group|Auth\User|false The merged returnValue |
||
66 | */ |
||
67 | protected function callOnEach($functionName, $args, $checkField = false, $checkValue = false, $resFunction = null) |
||
93 | |||
94 | /** |
||
95 | * Calls the indicated function on the specified method or all methods if false |
||
96 | * |
||
97 | * @param string|boolean $methodName The method to call the function on, or false to call on all functions |
||
98 | * @param string $functionName The function to call |
||
99 | * @param array $args The arguments for the function |
||
100 | * @param boolean|string $checkField A field to check if it is set a certain way before calling the function |
||
101 | * @param mixed $checkValue The value that field should be set to to not call the function |
||
102 | * @param callable $resFunction Function to call on the result, otherwise the function will return on the first non-false result |
||
103 | * |
||
104 | * @return mixed The return value |
||
105 | */ |
||
106 | protected function callFunction($methodName, $functionName, $args, $checkField = false, $checkValue = false, $resFunction = null) |
||
115 | } |
||
116 | /* vim: set tabstop=4 shiftwidth=4 expandtab: */ |
||
117 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.