Conditions | 1 |
Paths | 1 |
Total Lines | 6 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | public static function updatePropCb(object $obj, string $prop, callable $cb): void |
||
30 | { |
||
31 | $refObject = new ReflectionObject($obj); |
||
32 | $refProperty = $refObject->getProperty($prop); |
||
33 | $refProperty->setAccessible(true); |
||
34 | $refProperty->setValue($obj, $cb($refProperty->getValue($obj))); |
||
35 | } |
||
50 |