BitType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 15
ccs 0
cts 5
cp 0
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSQLDeclaration() 0 6 3
1
<?php
2
3
namespace CodexShaper\DBM\Database\Types\Mysql;
4
5
use CodexShaper\DBM\Database\Types\Type;
6
use Doctrine\DBAL\Platforms\AbstractPlatform;
7
8
class BitType extends Type
9
{
10
    const NAME = 'bit';
11
12
    /**
13
     * Register bit type.
14
     *
15
     * @return string
16
     */
17
    public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
18
    {
19
        $length = empty($fieldDeclaration['length']) ? 1 : $fieldDeclaration['length'];
20
        $length = $length > 64 ? 64 : $length;
21
22
        return "bit({$length})";
23
    }
24
}
25