Completed
Push — master ( 8f69e2...0f05a9 )
by ARCANEDEV
06:56
created

MySqlExpression::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 0
cts 4
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php namespace Arcanedev\LaravelMetrics\Expressions\IfNull;
2
3
use Arcanedev\LaravelMetrics\Expressions\Expression;
4
5
/**
6
 * Class     MySqlExpression
7
 *
8
 * @package  Arcanedev\LaravelMetrics\Expressions\IfNull
9
 * @author   ARCANEDEV <[email protected]>
10
 */
11
class MySqlExpression extends Expression
12
{
13
    /* -----------------------------------------------------------------
14
     |  Main Methods
15
     | -----------------------------------------------------------------
16
     */
17
18
    /**
19
     * Get the value of the expression.
20
     *
21
     * @return string
22
     */
23
    public function getValue()
24
    {
25
        return "IF(ISNULL(`{$this->value}`), 0, 1)";
26
    }
27
}
28