phpmyadmin/src/Identifiers/InvalidDatabaseName.php
Maurício Meneghini Fauth c2955cc2b2
Rename the directory libraries/classes/ to src/
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-08-30 15:59:28 -03:00

28 lines
684 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Identifiers;
use function __;
use function sprintf;
class InvalidDatabaseName extends InvalidIdentifier
{
public static function fromEmptyName(): self
{
return new self(__('The database name must be a non-empty string.'));
}
/** @psalm-param positive-int $length */
public static function fromLongName(int $length): self
{
return new self(sprintf(__('The database name cannot be longer than %d characters.'), $length));
}
public static function fromNameWithTrailingSpace(): self
{
return new self(__('The database name cannot end with a space character.'));
}
}