CoreFiles by mySites.guru
InvalidOptionException.php34 lines, 951 bytes, from Joomla_6.1.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 6.1.0-alpha1
md5
22802ea075df93993b89a2f879a3c6fc
sha1
2461639daffe0fdd2ea6ac8f0c2340a5439f1393
sha256
e7bb83bffc15c63ad71d4761183e09a6080252a9e4d72b21ce473bb168713303
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console\Exception;

/**
 * Represents an incorrect option name or value typed in the console.
 *
 * @author Jérôme Tamarelle <[email protected]>
 */
class InvalidOptionException extends \InvalidArgumentException implements ExceptionInterface
{
    /**
     * @internal
     */
    public static function fromEnumValue(string $name, string $value, array|\Closure $suggestedValues): self
    {
        $error = \sprintf('The value "%s" is not valid for the "%s" option.', $value, $name);

        if (\is_array($suggestedValues)) {
            $error .= \sprintf(' Supported values are "%s".', implode('", "', $suggestedValues));
        }

        return new self($error);
    }
}

The same content is in 30 releases, Joomla 6.1.0-alpha2 to 6.2.1-rc1. See them all, or every version of this file.