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

UnknownColumnType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 11
dl 0
loc 14
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A new() 0 12 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\DBAL\Types\Exception;
6
7
use Doctrine\DBAL\DBALException;
8
use function sprintf;
9
10
final class UnknownColumnType extends DBALException implements TypesException
11
{
12 27
    public static function new(string $name) : self
13
    {
14 27
        return new self(
15 27
            sprintf(
16
                'Unknown column type "%s" requested. Any Doctrine type that you use has '
17
                    . 'to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the '
18
                    . 'known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database '
19
                    . 'introspection then you might have forgotten to register all database types for a Doctrine Type. '
20
                    . 'Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement '
21
                    . 'Type#getMappedDatabaseTypes(). If the type name is empty you might '
22 2
                    . 'have a problem with the cache or forgot some mapping information.',
23 27
                $name
24
            )
25
        );
26
    }
27
}
28