getRoute()?->getArguments(); $id = $route_args['station_id'] ?? null; if (!empty($id)) { $record = $this->station_repo->findByIdentifier($id); if ($record instanceof Entity\Station) { $request = $request->withAttribute(ServerRequest::ATTR_STATION, $record); } } return $handler->handle($request); } }