Exemplo n.º 1
0
 /**
  * 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);
 }
Exemplo n.º 2
0
 public function __construct($policyName, $message, $code, Exception $previous)
 {
     $this->policyName = $policyName;
     parent::__construct($message, $code, $previous);
 }
Exemplo n.º 3
0
 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);
 }