<?php
declare(strict_types=1);

namespace PpPhp\Core\Designer\Build\Builders;

use PpPhp\Core\Designer\Build\Contracts\BuildArtifact;

final class RouteBuilder
{
    public function build(array $routes): BuildArtifact
    {
        return BuildArtifact::create(
            'routes_json',
            'routes',
            'routes.json',
            json_encode(array_values($routes), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES),
            ['routes' => count($routes)]
        );
    }
}
