namespace PhpMyAdmin\Dbal;
use Webmozart\Assert\Assert;
use Webmozart\Assert\InvalidArgumentException;
final class DatabaseName implements Stringable
* @see https://dev.mysql.com/doc/refman/en/identifier-length.html
* @see https://mariadb.com/kb/en/identifier-names/#maximum-length
private const MAX_LENGTH = 64;
* @psalm-var non-empty-string
* @throws InvalidArgumentException
private function __construct($name)
Assert::stringNotEmpty($name);
Assert::maxLength($name, self::MAX_LENGTH);
Assert::notEndsWith($name, ' ');