deviceRepository = $deviceRepository; $this->scanJobRepository = $scanJobRepository; } public function index(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface { ob_start(); $username = $_SESSION['username'] ?? 'User'; $deviceCount = $this->deviceRepository->getCount(); $newDiscoveries = $this->deviceRepository->getNewDiscoveriesCount(); $recentScans = $this->scanJobRepository->findRecent(5); require dirname(__DIR__, 2) . '/templates/dashboard/index.php'; $body = ob_get_clean(); $response->getBody()->write($body); return $response; } }