Passed
Push — master ( a081b1...b41f00 )
by Sebastian
03:19 queued 11s
created

Functions   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 15
ccs 9
cts 9
cp 1
rs 10
wmc 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A strval() 0 12 5
1
<?php
2
3
namespace Seboettg\Collection\ArrayList;
4
5
final class Functions
6
{
7
8 3
    public static function strval($value): string {
9 3
        if (is_double($value)) {
10 2
            $str = \strval($value);
11 2
            if (strlen($str) == 1) {
12 1
                return sprintf("%1\$.1f",$value);
13
            }
14 2
            return \strval($value);
15
        }
16 2
        if (is_bool($value)) {
17 1
            return $value ? "true" : "false";
18
        }
19 2
        return "$value";
20
    }
21
}
22
23
function strval($value): string {
24 3
    return Functions::strval($value);
25
}
26