@@ 107-111 (lines=5) @@ | ||
104 | $object = $reflectionClass->newInstanceWithoutConstructor(); |
|
105 | $reflectionObject = new \ReflectionObject($object); |
|
106 | ||
107 | foreach ($rule->getMap() as $property => $key) { |
|
108 | $reflectionProperty = $reflectionObject->getProperty($property); |
|
109 | $reflectionProperty->setAccessible(true); |
|
110 | $reflectionProperty->setValue($object, $data[$key]); |
|
111 | } |
|
112 | ||
113 | return $object; |
|
114 | } |
|
@@ 128-132 (lines=5) @@ | ||
125 | $reflectionObject = new \ReflectionObject($object); |
|
126 | $result = []; |
|
127 | ||
128 | foreach ($rule->getMap() as $property => $key) { |
|
129 | $reflectionProperty = $reflectionObject->getProperty($property); |
|
130 | $reflectionProperty->setAccessible(true); |
|
131 | $result[$key] = $reflectionProperty->getValue($object); |
|
132 | } |
|
133 | ||
134 | return $result; |
|
135 | } |