Passed
Push — master ( b07fd7...222f48 )
by y
01:35
created

Text   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A toDateTime() 0 2 1
1
<?php
2
3
namespace Helix\DB\SQL;
4
5
/**
6
 * Represents a text expression. Produces various transformations.
7
 */
8
class Text extends Value {
9
10
    use TextTrait;
11
12
    /**
13
     * Interpret the expression as a datetime.
14
     *
15
     * > Warning: If the expression is in the local timezone
16
     * > you should chain this with {@link DateTime::toUtc()}
17
     *
18
     * SQLite:
19
     * - The expression's value must conform to one of any `time-value` formats.
20
     * - https://www.sqlite.org/lang_datefunc.html
21
     *
22
     * MySQL:
23
     * - The expression's value must conform to `YYYY-MM-DD hh:mm:ss`
24
     *
25
     * @return DateTime
26
     */
27
    public function toDateTime () {
28
        return DateTime::factory($this->db, $this);
29
    }
30
}