Types   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getClassOrType() 0 9 2
1
<?php
2
/**
3
 * Copyright (c) 2010–2019 Ryan Parman <http://ryanparman.com>.
4
 * Copyright (c) 2016–2019 Contributors.
5
 *
6
 * http://opensource.org/licenses/Apache2.0
7
 */
8
9
declare(strict_types=1);
10
11
namespace SimplePie\UtilityPack\Util;
12
13
class Types
14
{
15
    /**
16
     * Gets the most useful description of the value's type.
17
     *
18
     * @param mixed $param The value to check.
19
     *
20
     * @return string The description of the type of the value.
21
     */
22 3
    public static function getClassOrType($param): string
23
    {
24 3
        $type = \gettype($param);
25
26 3
        if ('object' === $type) {
27 3
            return \get_class((object) $param);
28
        }
29
30 1
        return $type;
31
    }
32
}
33