NameIsReserved::new()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 9
cp 0
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Migrations\Finder\Exception;
6
7
use InvalidArgumentException;
8
use function sprintf;
9
use const PHP_EOL;
10
11
final class NameIsReserved extends InvalidArgumentException implements FinderException
12
{
13
    public static function new(string $version) : self
14
    {
15
        return new self(sprintf(
16
            'Cannot load a migrations with the name "%s" because it is reserved by Doctrine Migrations.'
17
            . PHP_EOL
18
            . 'It is used to revert all migrations including the first one.',
19
            $version
20
        ));
21
    }
22
}
23