summaryrefslogtreecommitdiff
path: root/vendor/doctrine/dbal/src/Platforms/Exception/InvalidPlatformVersion.php
blob: dd701905aeaa4abcb6faea30d9869d2c1183b13e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

declare(strict_types=1);

namespace Doctrine\DBAL\Platforms\Exception;

use Exception;

use function sprintf;

/** @psalm-immutable */
final class InvalidPlatformVersion extends Exception implements PlatformException
{
    /**
     * Returns a new instance for an invalid specified platform version.
     *
     * @param string $version        The invalid platform version given.
     * @param string $expectedFormat The expected platform version format.
     */
    public static function new(string $version, string $expectedFormat): self
    {
        return new self(sprintf(
            'Invalid platform version "%s" specified. The platform version has to be specified in the format: "%s".',
            $version,
            $expectedFormat,
        ));
    }
}