Reflection::getClassShortName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Rafidion Michael
5
 * Date: 07/12/2014
6
 * Time: 12:21
7
 */
8
9
namespace Mykees\TagBundle\Util;
10
11
12
class Reflection {
13
14
    public static function getClassName($model)
15
    {
16
        $reflection = new \ReflectionClass($model);
17
        return $reflection->getName();
18
    }
19
20
    public static function getClassShortName ( $model ) {
21
        $reflection = new \ReflectionClass( $model );
22
        return $reflection->getShortName();
23
    }
24
25
    public static function getBundlePath ( $model  ){
26
        $explode = explode('\\', self::getClassName($model ));
27
        return $explode[0].'\\'.$explode[1].'\\'.$explode[2].'\\'.$explode[3];
28
    }
29
30
    public static function getBundleRepository ( $model  ){
31
        $explode = explode('\\', self::getClassName($model ));
32
        return $explode[0].$explode[1].':'.$explode[3];
33
    }
34
35
}
36