<?php

declare(strict_types=1);

/*
 * This file is part of SolidInvoice project.
 *
 * (c) Pierre du Plessis <open-source@solidworx.co>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

// !! This file is autogenerated. Do not edit. !!

namespace SolidInvoice\NotificationBundle\Configurator;

use SolidInvoice\NotificationBundle\Form\Type\Transport\{{ name }}Type;
use Symfony\Component\Notifier\Transport\Dsn;
use function sprintf;
use function urlencode;

/**
 * @codeCoverageIgnore
 */
final class {{ name }}Configurator implements ConfiguratorInterface
{
    public static function getName(): string
    {
        return '{{ name }}';
    }

    public static function getType(): string
    {
        return '{{ type }}';
    }

    public function getForm(): string
    {
        return {{ name }}Type::class;
    }

    /**
     * @param array{ {% for option in options %}{{ option }}: string{% if not loop.last %}, {% endif %}{% endfor %} } $config
     */
    public function configure(array $config): Dsn
    {
        return new Dsn(sprintf('{{ dsn }}', {% for option in options %}urlencode($config['{{ option }}']){% if not loop.last %}, {% endif %}{% endfor %}));
    }
}
