Completed
Push — develop ( 0c4aa7...b62acb )
by Sergei
55s queued 14s
created

ColumnLengthRequired::new()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Exception;
6
7
use Doctrine\DBAL\DBALException;
8
use Doctrine\DBAL\Platforms\AbstractPlatform;
9
use function sprintf;
10
11
final class ColumnLengthRequired extends DBALException
12
{
13
    /**
14
     * @param AbstractPlatform $platform The target platform
15
     * @param string           $type     The SQL column type
16
     */
17 267
    public static function new(AbstractPlatform $platform, string $type) : self
18
    {
19 267
        return new self(
20 267
            sprintf(
21 17
                'The "%s" platform requires the length of a %s column to be specified',
22 267
                $platform->getName(),
23 267
                $type
24
            )
25
        );
26
    }
27
}
28