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

ColumnSchemaBuilder::getDefault()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
c 0
b 0
f 0
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