Completed
Pull Request — develop (#3586)
by Sergei
64:13 queued 45s
created

ColumnLengthRequired   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 13
rs 10
c 0
b 0
f 0

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\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
    public static function new(AbstractPlatform $platform, string $type) : self
18
    {
19
        return new self(
20
            sprintf(
21
                'The "%s" platform requires the length of a %s column to be specified',
22
                $platform->getName(),
23
                $type
24
            )
25
        );
26
    }
27
}
28