Completed
Push — master ( f8aa87...3441dd )
by Nikola
03:12
created

Exception   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A typeOf() 0 9 3
1
<?php
2
/*
3
 * This file is part of the Backup package, an RunOpenCode project.
4
 *
5
 * (c) 2015 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
 * This project is fork of "kbond/php-backup", for full credits info, please
11
 * view CREDITS file that was distributed with this source code.
12
 */
13
namespace RunOpenCode\Backup\Exception;
14
15
use RunOpenCode\Backup\Contract\ExceptionInterface;
16
17
class Exception extends \Exception implements ExceptionInterface
18
{
19
    /**
20
     * Get type of argument for exception messages.
21
     *
22
     * @param $arg
23
     * @return string
24
     */
25
    public static function typeOf($arg) {
26
        if (is_null($arg)) {
27
            return 'NULL';
28
        } elseif (is_object($arg)) {
29
            return get_class($arg);
30
        } else {
31
            return gettype($arg);
32
        }
33
    }
34
}
35