<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Compatibility\Adapters;

use PpPhp\Core\Platform\Compatibility\CompatibilityAdapter;
use PpPhp\Core\Platform\Foundation\PlatformMetadata;
use PpPhp\Core\Platform\Services\Metadata\MetadataFactory;
use PpPhp\Core\Platform\Services\Metadata\ServiceMetadata;

final class LegacyMetadataAdapter extends CompatibilityAdapter
{
    public function __construct()
    {
        parent::__construct('legacy-metadata-adapter', 'core/Platform/Metadata', 'core/Platform/Foundation + core/Platform/Services/Metadata', 'active');
    }

    public function platform(array $data = []): PlatformMetadata { return new PlatformMetadata($data); }
    public function service(array $data): ServiceMetadata { return MetadataFactory::service($data); }
}
