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

PostgresExpression   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 17
c 0
b 0
f 0
wmc 1
lcom 1
cbo 1
ccs 0
cts 4
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 4 1
1
<?php namespace Arcanedev\LaravelMetrics\Expressions\IfNull;
2
3
/**
4
 * Class     PostgresExpression
5
 *
6
 * @package  Arcanedev\LaravelMetrics\Expressions\IfNull
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class PostgresExpression extends MySqlExpression
10
{
11
    /* -----------------------------------------------------------------
12
     |  Main Methods
13
     | -----------------------------------------------------------------
14
     */
15
16
    /**
17
     * Get the value of the expression.
18
     *
19
     * @return string
20
     */
21
    public function getValue()
22
    {
23
        return "CASE WHEN {$this->value} IS NULL THEN 0 ELSE 1 END";
24
    }
25
}
26