Flow   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 13
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A mysql_if() 0 3 2
1
<?php
2
3
namespace Vectorface\MySQLite\MySQL;
4
5
/**
6
 * Provides Flow Control MySQL compatibility functions for SQLite.
7
 *
8
 * http://dev.mysql.com/doc/refman/5.7/en/control-flow-functions.html
9
 */
10
trait Flow
11
{
12
    /**
13
     * IF - If/else construct
14
     *
15
     * @param bool $condition The boolean condition which determines which result should be returned.
16
     * @param mixed $onTrue The result to be returned if the condition is true.
17
     * @param mixed $onFalse The condition to be returned if the condition is false.
18
     * @return mixed Either the onTrue or onFalse result is returned, depending on the value of the condition.
19
     */
20 1
    public static function mysql_if($condition, $onTrue, $onFalse)
21
    {
22 1
        return $condition ? $onTrue : $onFalse;
23
    }
24
}
25