Numeric   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A mysql_sqrt() 0 3 1
A mysql_rand() 0 3 1
1
<?php
2
3
namespace Vectorface\MySQLite\MySQL;
4
5
/**
6
 * Provides Numeric MySQL compatibility functions for SQLite.
7
 *
8
 * http://dev.mysql.com/doc/refman/5.7/en/numeric-functions.html
9
 */
10
trait Numeric
11
{
12
    /**
13
     * SQRT - Return the square root of the argument
14
     *
15
     * @param mixed $value A numeric value for which a square root is to be calculated.
16
     * @return float The square root of the given numeric value.
17
     */
18 1
    public static function mysql_sqrt($value)
19
    {
20 1
        return sqrt($value);
21
    }
22
23
    /**
24
     * RAND - Returns a random floating-point
25
     * @return float
26
     */
27 1
    public static function mysql_rand()
28
    {
29 1
        return mt_rand() / mt_getrandmax();
30
    }
31
}
32