Completed
Push — master ( e8a810...7ca800 )
by Andrew
07:51 queued 05:38
created

Util::readProperty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
crap 1
1
<?php
2
3
namespace AndrewCarterUK\NoMoreLeaksBundle;
4
5
class Util
6
{
7
    public static function readProperty($object, $property)
8
    {
9 2
        $closure = \Closure::bind(function () use ($object, $property) {
10 2
            return $object->{$property};
11 2
        }, null, $object);
12
13 2
        return $closure();
14
    }
15
}
16