Passed
Push — master ( e1c603...5834c4 )
by y
01:26
created

DateTime   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 7
c 1
b 0
f 1
dl 0
loc 18
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A now() 0 5 1
1
<?php
2
3
namespace Helix\DB\Fluent;
4
5
use Helix\DB;
6
use Helix\DB\Fluent\DateTime\DateTimeTrait;
7
use Helix\DB\Fluent\Str\StrCastTrait;
8
9
/**
10
 * A date-time expression.
11
 */
12
class DateTime extends Expression implements ValueInterface
13
{
14
15
    use DateTimeTrait;
0 ignored issues
show
introduced by
The trait Helix\DB\Fluent\DateTime\DateTimeTrait requires some properties which are not provided by Helix\DB\Fluent\DateTime: $s, $y, $m, $i, $h, $d
Loading history...
16
    use FactoryFormatTrait;
17
    use StrCastTrait;
18
19
    /**
20
     * An expression for the current date and time.
21
     *
22
     * @param DB $db
23
     * @return static
24
     */
25
    public static function now(DB $db)
26
    {
27
        return static::fromFormat($db, [
28
            'mysql' => "NOW()",
29
            'sqlite' => "DATETIME('now')"
30
        ]);
31
    }
32
}
33