Passed
Push — master ( a902c5...cb0acc )
by Def
03:41
created

ColumnSchemaBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDefault() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Mssql;
6
7
use Yiisoft\Db\Expression\Expression;
8
use Yiisoft\Db\Schema\AbstractColumnSchemaBuilder;
9
10
final class ColumnSchemaBuilder extends AbstractColumnSchemaBuilder
11
{
12
    /**
13
     * Getting the `Default` value for constraint
14
     *
15
     * @return Expression|string|null
16
     */
17 8
    public function getDefault(): Expression|string|null
18
    {
19 8
        if ($this->default instanceof Expression) {
20 3
            return $this->default;
21
        }
22
23 7
        return $this->buildDefaultValue();
24
    }
25
}
26