session->start(); $_SESSION['flash'] = [ 'type' => $type, 'message' => $message, ]; } public function get(): ?array { $this->session->start(); if (empty($_SESSION['flash']) || !is_array($_SESSION['flash'])) { return null; } $f = $_SESSION['flash']; unset($_SESSION['flash']); return [ 'type' => (string)($f['type'] ?? 'info'), 'message' => (string)($f['message'] ?? ''), ]; } }