@@ 39-46 (lines=8) @@ | ||
36 | return $reflectionClass->newInstanceWithoutConstructor(); |
|
37 | } |
|
38 | ||
39 | public static function setProtectedProperty($object, string $propertyName, $value) |
|
40 | { |
|
41 | $class = self::getReflectionClass(get_class($object)); |
|
42 | ||
43 | $property = ClassHelper::getReflectionProperty($class, $propertyName); |
|
44 | $property->setAccessible(true); |
|
45 | $property->setValue($object, $value); |
|
46 | } |
|
47 | ||
48 | public static function getProtectedProperty($object, string $propertyName) |
|
49 | { |
|
@@ 48-56 (lines=9) @@ | ||
45 | $property->setValue($object, $value); |
|
46 | } |
|
47 | ||
48 | public static function getProtectedProperty($object, string $propertyName) |
|
49 | { |
|
50 | $class = self::getReflectionClass(get_class($object)); |
|
51 | ||
52 | $property = ClassHelper::getReflectionProperty($class, $propertyName); |
|
53 | $property->setAccessible(true); |
|
54 | ||
55 | return $property->getValue($object); |
|
56 | } |
|
57 | } |
|
58 |