Completed
Push — master ( 331a58...d50446 )
by Marco
293:07 queued 268:05
created

Assert   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A readAttribute() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ProxyManagerTest;
6
7
use ReflectionObject;
8
9
/**
10
 * @internal
11
 */
12
final class Assert
13
{
14
    /**
15
     * @return mixed
16
     */
17
    public static function readAttribute(object $object, string $propertyName)
18
    {
19
        $reflection = new ReflectionObject($object);
20
        $property   = $reflection->getProperty($propertyName);
21
        $property->setAccessible(true);
22
23
        return $property->getValue($object);
24
    }
25
}
26