Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
30 | protected function setProperty(\ReflectionObject $reflection, $object, $property, $value) |
||
31 | { |
||
32 | $property = $reflection->getProperty($property); |
||
33 | |||
34 | if ($property->isPublic()) { |
||
35 | $property->setValue($object, $value); |
||
36 | return; |
||
37 | } |
||
38 | |||
39 | $property->setAccessible(true); |
||
40 | $property->setValue($object, $value); |
||
41 | $property->setAccessible(false); |
||
42 | } |
||
43 | } |
||
44 |