Factory.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * The interface that all hash implementations must implement
  4. *
  5. * PHP version 5.3
  6. *
  7. * @category PHPSecurityLib
  8. * @package Hash
  9. * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
  10. * @copyright 2011 The Authors
  11. * @license http://opensource.org/licenses/bsd-license.php New BSD License
  12. * @license http://www.gnu.org/licenses/lgpl-2.1.html LGPL v 2.1
  13. */
  14. namespace SecurityLibTest\Mocks;
  15. /**
  16. * The interface that all hash implementations must implement
  17. *
  18. * @category PHPSecurityLib
  19. * @package Hash
  20. * @author Anthony Ferrara <ircmaxell@ircmaxell.com>
  21. */
  22. class Factory extends \SecurityLib\AbstractFactory {
  23. protected $callbacks = array();
  24. public static function init() {}
  25. public function __construct(array $callbacks = array()) {
  26. $this->callbacks = $callbacks;
  27. }
  28. public function __call($name, array $args = array()) {
  29. if (isset($this->callbacks[$name])) {
  30. return call_user_func_array($this->callbacks[$name], $args);
  31. }
  32. return null;
  33. }
  34. public function registerType($a1, $a2, $a3, $a4, $a5 = false) {
  35. return parent::registerType($a1, $a2, $a3, $a4, $a5);
  36. }
  37. public function loadFiles($dir, $name, $method) {
  38. return parent::loadFiles($dir, $name, $method);
  39. }
  40. }