Passed
Push — master ( 22b347...ceff3e )
by y
01:34
created

Num   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toText() 0 5 2
1
<?php
2
3
namespace Helix\DB\SQL;
4
5
/**
6
 * Represents a numeric expression. Produces various transformations.
7
 */
8
class Num extends Value {
9
10
    use NumTrait;
11
12
    /**
13
     * Casts the expression to a character string.
14
     *
15
     * @return Text
16
     */
17
    public function toText () {
18
        if ($this->db->isSQLite()) {
19
            return Text::factory($this->db, "CAST({$this} AS TEXT)");
20
        }
21
        return Text::factory($this->db, "CAST({$this} AS CHAR)");
22
    }
23
}