Code Duplication    Length = 14-14 lines in 2 locations

src/Reader/Mapper/Exif/DateTimeFieldMapper.php 1 location

@@ 74-87 (lines=14) @@
71
    /**
72
     * {@inheritDoc}
73
     */
74
    public function mapField($field, array $input, &$output)
75
    {
76
        $this->guardInvalidArguments($field, $input, $output);
77
78
        foreach ($this->validKeys as $key) {
79
            if (!array_key_exists($key, $input)) {
80
                continue;
81
            }
82
83
            $datetimeOriginal = new DateTimeImmutable($input[$key]);
84
            $output = $output->withCreationDate($datetimeOriginal);
85
            break;
86
        }
87
    }
88
}
89

src/Reader/Mapper/Exif/ExposureTimeFieldMapper.php 1 location

@@ 70-83 (lines=14) @@
67
    /**
68
     * {@inheritDoc}
69
     */
70
    public function mapField($field, array $input, &$output)
71
    {
72
        $this->guardInvalidArguments($field, $input, $output);
73
74
        foreach ($this->validKeys as $key) {
75
            if (!array_key_exists($key, $input)) {
76
                continue;
77
            }
78
79
            $shutterSpeed = new ExposureTime($input[$key]);
80
            $output = $output->withExposureTime($shutterSpeed);
81
            break;
82
        }
83
    }
84
}
85