<?php

declare(strict_types=1);

namespace App\Framework\Core\Events;

use App\Framework\Core\ValueObjects\ClassName;
use App\Framework\Core\ValueObjects\Timestamp;
use App\Framework\Http\Request;

final readonly class BeforeMiddlewareExecution
{
    public readonly Timestamp $timestamp;

    public function __construct(
        public Request $request,
        public ClassName $middlewareClass,
        public int $priority,
        ?Timestamp $timestamp = null,
        public array $context = []
    ) {
        $this->timestamp = $timestamp ?? Timestamp::now();
    }
}
