/** * @param Request|WebRequest $request * @return \watoki\curir\delivery\WebResponse */ public function respond(Request $request) { $this->app->prepare($request); if (!$this->isContainerTarget($request)) { $request = $request->withTarget(Path::fromString('execute'))->withArgument(ExecuteResource::ACTION_ARG, $request->getTarget()->toString()); } return parent::respond($request); }
public function respond(Request $request) { try { return parent::respond($request); } catch (\Exception $e) { throw new HttpError(WebResponse::STATUS_SERVER_ERROR, $e->getMessage(), null, 0, $e); } }
protected function createRouterFor($class) { $router = parent::createRouterFor($class); $fileStore = $this->factory->getInstance(FlatFileStore::class, array("basePath" => $this->getMockFolder())); $reflection = new \ReflectionClass($router); $store = $reflection->getProperty('store'); $store->setAccessible(true); $store->setValue($router, $fileStore); return $router; }
public function after($return, WebRequest $request) { $response = parent::after($return, $request); $response->setBody($this->boxes->mergeHeaders($response->getBody(), $request->getContext())); return $response; }
/** * @param Request|WebRequest $request * @return \watoki\curir\delivery\WebResponse */ public function respond(Request $request) { $request = $request->withTarget(Path::fromString('execute'))->withArgument(ExecuteResource::ACTION_ARG, $request->getTarget()->toString()); return parent::respond($request); }
public function respond(Request $request) { return parent::respond($request); }