<?php

namespace App\Framework\StaticSite;

use App\Framework\Attributes\Route;
use App\Framework\Attributes\StaticPage;
use App\Framework\Core\AttributeMapper;

final readonly class StaticSiteMapper implements AttributeMapper
{

    public function getAttributeClass(): string
    {
        return StaticPage::class;
    }

    public function map(object $reflectionTarget, object $attributeInstance): ?array
    {
        $route = $reflectionTarget->getAttributes(Route::class);


        return [
            'route' => $route[0]->newInstance()->path,
        ];
    }
}
