<?php

declare(strict_types=1);

namespace App\Framework\Http\Session;

use App\Framework\DateTime\Clock;
use App\Framework\Security\CsrfTokenGenerator;

interface SessionInterface
{
    public function get(string $key, mixed $default = null): mixed;

    public function set(string $key, mixed $value): void;

    public function has(string $key): bool;

    public function remove(string $key): void;

    public function clear(): void;

    public function all(): array;

    public function getId(): SessionId;

    public CsrfProtection $csrf { get; }

    public ValidationErrorBag $validation { get; }

    public FormDataStorage $form { get; }

    public static function fromArray(SessionId $sessionId, Clock $clock, CsrfTokenGenerator $csrfTokenGenerator, array $data): self;
}
