This commit is contained in:
1 parent
f7c532a648
commit
640bd67556
5801 files changed
+484532
-55857
No files matched your search
@@ -16,4 +16,17 @@ namespace Symfony\Component\Console\Exception;
|
||||
*/
|
||||
class InvalidArgumentException 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" argument.', $value, $name);
|
||||
|
||||
if (\is_array($suggestedValues)) {
|
||||
$error .= \sprintf(' Supported values are "%s".', implode('", "', $suggestedValues));
|
||||
}
|
||||
|
||||
return new self($error);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user