Passed
Push — master ( fc6bbf...e39fda )
by Alexander
05:11
created

Migration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 11
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A notNullTimestamp() 0 8 2
1
<?php
2
3
namespace Horat1us\Yii;
4
5
use yii\db;
6
7
/**
8
 * Class Migration
9
 * @package Horat1us\Yii
10
 */
11
class Migration extends db\Migration
12
{
13
    public function notNullTimestamp(): db\ColumnSchemaBuilder
14
    {
15
        if ($this->db->driverName === 'mysql') {
16
            return $this->timestamp()->notNull()->defaultExpression('now()');
17
        }
18
19
        return $this->timestamp()->notNull();
20
    }
21
}
22