Skip to content

Commit d15df3d

Browse files
committed
Code simplification
1 parent 1a259fd commit d15df3d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Transformer/ArgumentsTransformer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ private function populateObject(Type $type, $data, bool $multiple, ResolveInfo $
102102
$fields = $type->getFields();
103103

104104
foreach ($fields as $name => $field) {
105-
$fieldData = \array_key_exists($name, $data) ? $this->accessor->getValue($data, sprintf('[%s]', $name)) : $this->accessor->getValue($instance, $name);
105+
if (!array_key_exists($name, $data)) {
106+
continue;
107+
}
108+
$fieldData = $this->accessor->getValue($data, sprintf('[%s]', $name));
106109
$fieldType = $field->getType();
107110

108111
if ($fieldType instanceof NonNull) {

0 commit comments

Comments
 (0)