Ejemplo n.º 1
0
 /**
  * @param DirectRequest $directRequest
  * @return array
  * @throws ActionNotFoundException
  * @throws MethodNotFoundException
  */
 protected function assertMetadata(DirectRequest $directRequest)
 {
     $actionMetadata = $this->serviceRegistry->getService($directRequest->getAction());
     if (!$actionMetadata) {
         throw new ActionNotFoundException($directRequest);
     }
     if (!isset($actionMetadata->methodMetadata[$directRequest->getMethod()])) {
         throw new MethodNotFoundException($directRequest);
     }
     return array($actionMetadata, $actionMetadata->methodMetadata[$directRequest->getMethod()]);
 }
Ejemplo n.º 2
0
 /**
  * @param Request    $request
  * @param \Exception $exception
  * @param bool       $debug
  * @return ExceptionResponse
  */
 public static function fromRequest(Request $request, \Exception $exception, $debug = false)
 {
     return new self($request->getTid(), $request->getAction(), $request->getMethod(), $exception, $debug);
 }