| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public static function allowAccessToProperty(string $className, string $propertyName) |
||
| 25 | { |
||
| 26 | // Create a reflection object for the class |
||
| 27 | $reflectionClass = new ReflectionClass($className); |
||
| 28 | |||
| 29 | // Get the protected property |
||
| 30 | $property = $reflectionClass->getProperty($propertyName); |
||
| 31 | |||
| 32 | // Make the property accessible |
||
| 33 | $property->setAccessible(true); |
||
| 34 | |||
| 35 | // Set the value of the protected property |
||
| 36 | return new $className(); |
||
| 37 | } |
||
| 39 |