<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\CoreBundle\Application;

/**
 * An upload for a `file` extra question was refused. The message is a translation
 * key from the `cms`/`admin` domains — the forms render it next to the input, so
 * it must never carry the internal reason (which goes to the log instead).
 */
final class ExtraFileRejected extends \RuntimeException
{
    public function __construct(
        private readonly string $translationKey,
        private readonly array $parameters = [],
        string $reason = '',
    ) {
        parent::__construct('' !== $reason ? $reason : $translationKey);
    }

    public function getTranslationKey(): string
    {
        return $this->translationKey;
    }

    public function getParameters(): array
    {
        return $this->parameters;
    }
}
