ClassNameInflector   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 4
Bugs 0 Features 1
Metric Value
c 4
b 0
f 1
dl 0
loc 24
wmc 2
lcom 1
cbo 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUserClassName() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of Sulu.
5
 *
6
 * (c) MASSIVE ART WebServices GmbH
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Sulu\Component\DocumentManager;
13
14
use ProxyManager\Inflector\ClassNameInflector as ProxyManagerClassNameInflector;
15
16
/**
17
 * This is a hack to statically use the ClassNameInflector to
18
 * retrieve the "real" class names for proxy objects.
19
 *
20
 * TODO: This should be a service dependency not a static class
21
 */
22
class ClassNameInflector
23
{
24
    /**
25
     * @var ProxyManagerClassNameInflector
26
     */
27
    public static $inflector;
28
29
    /**
30
     * Return the "real" class name if the given class name is a proxy
31
     * class name.
32
     *
33
     * @param string $className
34
     *
35
     * @return string
36
     */
37
    public static function getUserClassName($className)
38
    {
39
        if (null === self::$inflector) {
40
            static::$inflector = new ProxyManagerClassNameInflector('');
41
        }
42
43
        return static::$inflector->getUserClassName($className);
44
    }
45
}
46