Skip to content

Commit f235d64

Browse files
author
Яценко Андрей
committed
move get property
1 parent 52967f3 commit f235d64

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ClassTransformer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ private static function dataConverting(string $className, ...$args)
126126

127127
$instance = new $className();
128128
foreach ($refInstance->getProperties() as $item) {
129+
$property = $refInstance->getProperty($item->name);
130+
$propertyType = $property->getType();
131+
$propertyClassTypeName = self::getPropertyTypes($propertyType);
132+
129133
if (array_key_exists($item->name, $inArgs)) {
130134
$value = $inArgs[$item->name];
131135
} else {
@@ -151,10 +155,6 @@ private static function dataConverting(string $className, ...$args)
151155
}
152156
}
153157

154-
$property = $refInstance->getProperty($item->name);
155-
$propertyType = $property->getType();
156-
$propertyClassTypeName = self::getPropertyTypes($propertyType);
157-
158158
if (self::propertyIsScalar($propertyClassTypeName)) {
159159
$instance->{$item->name} = $value;
160160
continue;

0 commit comments

Comments
 (0)