NormalizeNamespaceTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 22
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A normalizeNamespace() 0 12 3
1
<?php
2
3
/*
4
* This file is part of the moss-storage package
5
*
6
* (c) Michal Wachowski <[email protected]>
7
*
8
* For the full copyright and license information, please view the LICENSE
9
* file that was distributed with this source code.
10
*/
11
12
namespace Moss\Storage;
13
14
/**
15
 * Trait NormalizeNamespaceTrait
16
 *
17
 * @package Moss\Storage
18
 */
19
trait NormalizeNamespaceTrait
20
{
21
    /**
22
     * Returns fully qualified absolute class name
23
     *
24
     * @param string|object $class
25
     *
26
     * @return string
27
     */
28
    public function normalizeNamespace($class)
29
    {
30
        if ($class === null) {
31
            return null;
32
        }
33
34
        if (is_object($class)) {
35
            $class = get_class($class);
36
        }
37
38
        return ltrim($class, '\\');
39
    }
40
}
41