ObjectUtil::getProperty()   A
last analyzed

Complexity

Conditions 4
Paths 5

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 4
nc 5
nop 2
1
<?php
2
3
namespace Ipag\Classes\Util;
4
5
final class ObjectUtil
6
{
7
    public function getProperty($object, $property)
8
    {
9
        if (!property_exists($object, $property)) {
10
            return;
11
        }
12
13
        return isset($object->$property) && is_string($object->$property) ? $object->$property : null;
14
    }
15
}
16