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

Exception::typeOf()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 3
eloc 7
nc 3
nop 1
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