function Constraint::getErrorName
Returns the name of the given error code.
Throws
InvalidArgumentException If the error code does not exist
File
-
vendor/
symfony/ validator/ Constraint.php, line 71
Class
- Constraint
- Contains the properties of a constraint definition.
Namespace
Symfony\Component\ValidatorCode
public static function getErrorName(string $errorCode) : string {
if (isset(static::ERROR_NAMES[$errorCode])) {
return static::ERROR_NAMES[$errorCode];
}
throw new InvalidArgumentException(\sprintf('The error code "%s" does not exist for constraint of type "%s".', $errorCode, static::class));
}