<?php

declare(strict_types=1);

namespace App\Framework\Core\Events;

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

final readonly class AfterRouteMatching
{
    public readonly Timestamp $timestamp;

    public function __construct(
        public Request $request,
        public ?string $routeName,
        public array $routeParameters,
        public Duration $matchingTime,
        ?Timestamp $timestamp = null,
        public array $context = []
    ) {
        $this->timestamp = $timestamp ?? Timestamp::now();
    }
}
