htdocs/class/libraries/vendor/ircmaxell/security-lib/test/Mocks/AbstractMock.php 1 location
|
@@ 24-41 (lines=18) @@
|
| 21 |
|
* @package Hash |
| 22 |
|
* @author Anthony Ferrara <[email protected]> |
| 23 |
|
*/ |
| 24 |
|
class AbstractMock { |
| 25 |
|
|
| 26 |
|
protected $callbacks = array(); |
| 27 |
|
|
| 28 |
|
public static function init() {} |
| 29 |
|
|
| 30 |
|
public function __construct(array $callbacks = array()) { |
| 31 |
|
$this->callbacks = $callbacks; |
| 32 |
|
} |
| 33 |
|
|
| 34 |
|
public function __call($name, array $args = array()) { |
| 35 |
|
if (isset($this->callbacks[$name])) { |
| 36 |
|
return call_user_func_array($this->callbacks[$name], $args); |
| 37 |
|
} |
| 38 |
|
return null; |
| 39 |
|
} |
| 40 |
|
|
| 41 |
|
} |
| 42 |
|
|
htdocs/class/libraries/vendor/ircmaxell/random-lib/test/Mocks/AbstractMock.php 1 location
|
@@ 35-52 (lines=18) @@
|
| 32 |
|
* |
| 33 |
|
* @author Anthony Ferrara <[email protected]> |
| 34 |
|
*/ |
| 35 |
|
class AbstractMock |
| 36 |
|
{ |
| 37 |
|
protected $callbacks = array(); |
| 38 |
|
|
| 39 |
|
public static function init() |
| 40 |
|
{ |
| 41 |
|
} |
| 42 |
|
|
| 43 |
|
public function __construct(array $callbacks = array()) |
| 44 |
|
{ |
| 45 |
|
$this->callbacks = $callbacks; |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public function __call($name, array $args = array()) |
| 49 |
|
{ |
| 50 |
|
if (isset($this->callbacks[$name])) { |
| 51 |
|
return call_user_func_array($this->callbacks[$name], $args); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
return null; |
| 55 |
|
} |