Completed
Push — master ( 794160...5bca01 )
by Nikola
03:58
created

ExchangeRateException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 21
rs 10
c 0
b 0
f 0
ccs 6
cts 6
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A typeOf() 0 12 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