Failed Conditions
Pull Request — develop (#3525)
by Jonathan
09:58
created

InvalidPlatformVersion   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 15
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A new() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Platforms\Exception;
6
7
use Doctrine\DBAL\DBALException;
8
use function sprintf;
9
10
final class InvalidPlatformVersion extends DBALException implements PlatformException
11
{
12
    /**
13
     * Returns a new instance for an invalid specified platform version.
14
     *
15
     * @param string $version        The invalid platform version given.
16
     * @param string $expectedFormat The expected platform version format.
17
     */
18 270
    public static function new(string $version, string $expectedFormat) : self
19
    {
20 270
        return new self(
21 270
            sprintf(
22 20
                'Invalid platform version "%s" specified. The platform version has to be specified in the format: "%s".',
23 270
                $version,
24 270
                $expectedFormat
25
            )
26
        );
27
    }
28
}
29