Code Duplication    Length = 11-11 lines in 2 locations

Core/FieldHandler/EzBinaryFile.php 1 location

@@ 22-32 (lines=11) @@
19
20
        if ($fieldValue === null) {
21
            return new BinaryFileValue();
22
        } if (is_string($fieldValue)) {
23
            $filePath = $fieldValue;
24
        } else {
25
            $filePath = $fieldValue['path'];
26
            if (isset($fieldValue['filename'])) {
27
                $fileName = $fieldValue['filename'];
28
            }
29
            if (isset($fieldValue['mime_type'])) {
30
                $mimeType = $fieldValue['mime_type'];
31
            }
32
        }
33
34
        // default format: path is relative to the 'files' dir
35
        $realFilePath = dirname($context['path']) . '/files/' . $filePath;

Core/FieldHandler/EzImage.php 1 location

@@ 24-34 (lines=11) @@
21
22
        if ($fieldValue === null) {
23
            return new ImageValue();
24
        } else if (is_string($fieldValue)) {
25
            $filePath = $fieldValue;
26
        } else {
27
            $filePath = $fieldValue['path'];
28
            if (isset($fieldValue['alt_text'])) {
29
                $altText = $fieldValue['alt_text'];
30
            }
31
            if (isset($fieldValue['filename'])) {
32
                $fileName = $fieldValue['filename'];
33
            }
34
        }
35
36
        // default format: path is relative to the 'images' dir
37
        $realFilePath = dirname($context['path']) . '/images/' . $filePath;