Code Duplication    Length = 4-4 lines in 2 locations

src/Schema/Type.php 2 locations

@@ 372-375 (lines=4) @@
369
        $required = $this->getRequiredProperties();
370
371
        foreach ($this->getProperties() as $index => $field) {
372
            if (in_array($field, $required) && !array_key_exists($index, $tuple)) {
373
                $propertyType = $this->getPropertyType($field);
374
                $tuple[$index] = $this->convention->getDefaultValue($propertyType);
375
            }
376
        }
377
378
        // normalize tuple
@@ 399-402 (lines=4) @@
396
        foreach ($this->getProperties() as $index => $name) {
397
            if (array_key_exists($name, $input)) {
398
                $output[$index] = $this->encodeProperty($name, $input[$name]);
399
                if (is_null($output[$index]) && in_array($name, $this->getRequiredProperties())) {
400
                    $propertyType = $this->getPropertyType($name);
401
                    $output[$index] = $this->convention->getDefaultValue($propertyType);
402
                }
403
            }
404
        }
405