Passed
Push — exceptions ( 722472 )
by Michael
15:25
created

UnknownColumnType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

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
9
final class UnknownColumnType extends DBALException implements TypesException
10
{
11
    public static function new(string $name) : self
12
    {
13
        return new self(
14
            sprintf(
15
                'Unknown column type "%s" requested. Any Doctrine type that you use has '
16
                    . 'to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all the '
17
                    . 'known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database '
18
                    . 'introspection then you might have forgotten to register all database types for a Doctrine Type. '
19
                    . 'Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement '
20
                    . 'Type#getMappedDatabaseTypes(). If the type name is empty you might '
21
                    . 'have a problem with the cache or forgot some mapping information.',
22
                $name
23
            )
24
        );
25
    }
26
}
27