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

DateTime::now()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
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