/** * Perform clean up / tear down tasks */ protected function tearDown() { prototypr\Registry::unregister('prototypr\\Tests\\Mock\\User'); }
/** * Delegates callback handling depending on the number of prototypes * @param string $class * @param string $name * @param array $arguments * @param mixed $scope * @return mixed */ protected static function invokeDelegate($class, $name, array $arguments, $scope) { $class = strtolower($class); $methods = Registry::prototypes($class); if (empty($methods)) { return; } $name = strtolower($name); if (array_key_exists($name, $methods)) { $method = $methods[$name]; if (!is_array($method)) { return self::invokeSingleCallback($method, $arguments, $scope); } else { return self::invokeMultipleCallbacks($method, $arguments, $scope); } } }