Comparison::mysql_least()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 8
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Vectorface\MySQLite\MySQL;
4
5
use InvalidArgumentException;
6
7
/**
8
 * Provides Comparison MySQL compatibility functions for SQLite.
9
 *
10
 * http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html
11
 */
12
trait Comparison
13
{
14
    /**
15
     * LEAST - Return the smallest argument
16
     *
17
     * @param mixed ... One or more numeric arguments.
18
     * @return mixed The argument whose value is considered lowest.
19
     */
20
    public static function mysql_least()
21
    {
22
        $args = func_get_args();
23
        if (!count($args)) {
24
            throw new InvalidArgumentException('No arguments provided to SQLite LEAST');
25
        }
26
27
        return min($args);
28
    }
29
}
30