ExchangeRateException::typeOf()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 12
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 9.8666
cc 3
nc 3
nop 1
crap 3
1
<?php
2
/*
3
 * This file is part of the Exchange Rate package, an RunOpenCode project.
4
 *
5
 * (c) 2017 RunOpenCode
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace RunOpenCode\ExchangeRate\Exception;
11
12
use RunOpenCode\ExchangeRate\Contract\ExceptionInterface;
13
14
/**
15
 * Class ExchangeRateException
16
 *
17
 * @package RunOpenCode\ExchangeRate\Exception
18
 */
19
class ExchangeRateException extends \Exception implements ExceptionInterface
20
{
21
    /**
22
     * Get type of argument for exception messages.
23
     *
24
     * @param $arg
25
     * @return string
26
     */
27 1
    public static function typeOf($arg) {
28
29 1
        if (null === $arg) {
30 1
            return 'NULL';
31
        }
32
33 1
        if (is_object($arg)) {
34 1
            return get_class($arg);
35
        }
36
37 1
        return gettype($arg);
38
    }
39
}
40