Passed
Pull Request — master (#61)
by Saiful
02:12
created

ClassUtils::getClass()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Xiidea\EasyAuditBundle\Common;
4
5
use Doctrine\Persistence\Proxy;
6
7
class ClassUtils
8
{
9
    public static function getClass($entity): string
10
    {
11
        if ($entity instanceof Proxy) {
12
            return get_parent_class($entity);
13
        }
14
15
        return get_class($entity);
16
    }
17
}