/** * Returns a RouteMatch for the given function or closure. * * @param string|\Closure $function * @param array $functionParameters * * @return RouteMatch The route match. * * @throws RoutingException If the function is invalid. */ public static function forFunction($function, array $functionParameters = []) { try { $controller = new \ReflectionFunction($function); } catch (\ReflectionException $e) { throw RoutingException::invalidControllerFunction($e, $function); } return new self($controller, $functionParameters); }
public function __construct($policyName, $message, $code, Exception $previous) { $this->policyName = $policyName; parent::__construct($message, $code, $previous); }
public function __construct(string $expectedType, $givenValue, \Exception $previous = null) { $this->expectedType = $expectedType; $this->givenValue = $givenValue; parent::__construct(sprintf("The given value doesn't match with expected type %s. %s given", $this->expectedType, $this->getGivenValueType()), null, $previous); }