Passed
Push — master ( 93ee33...95960a )
by Alec
11:11 queued 10s
created

typeOf()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 1
cp 0
rs 10
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AlecRabbit;
6
7
if (!function_exists(__NAMESPACE__ . '\typeOf')) {
8
    /**
9
     * Returns the type of a variable.
10
     *
11
     * @param mixed $var
12
     * @return string
13
     */
14
    function typeOf($var): string
15
    {
16
        return \is_object($var) ? \get_class($var) : \gettype($var);
17
    }
18
}
19