Completed
Push — master ( 27b3cb...f1c80d )
by Nikola
02:33
created

BackupException::typeOf()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
ccs 0
cts 6
cp 0
rs 9.6667
cc 3
eloc 7
nc 3
nop 1
crap 12
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
class BackupException extends \Exception
16
{
17
    /**
18
     * Get type of argument for exception messages.
19
     *
20
     * @param $arg
21
     * @return string
22
     */
23
    public static function typeOf($arg) {
24
        if (is_null($arg)) {
25
            return 'NULL';
26
        } elseif (is_object($arg)) {
27
            return get_class($arg);
28
        } else {
29
            return gettype($arg);
30
        }
31
    }
32
}
33