summaryrefslogtreecommitdiff
path: root/vendor/doctrine/dbal/src/Schema/Exception/IndexNameInvalid.php
blob: d295eb8a2765964d34812df0727d3eb64900b0a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Schema\Exception;

use Doctrine\DBAL\Schema\SchemaException;
use InvalidArgumentException;

use function sprintf;

/** @psalm-immutable */
final class IndexNameInvalid extends InvalidArgumentException implements SchemaException
{
    public static function new(string $indexName): self
    {
        return new self(sprintf('Invalid index name "%s" given, has to be [a-zA-Z0-9_].', $indexName));
    }
}