Code Duplication    Length = 11-11 lines in 2 locations

Core/ComplexField/EzBinaryFile.php 1 location

@@ 29-39 (lines=11) @@
26
27
        if ($fieldValue === null) {
28
            return new BinaryFileValue();
29
        } if (is_string($fieldValue)) {
30
            $filePath = $fieldValue;
31
        } else {
32
            $filePath = $fieldValue['path'];
33
            if (isset($fieldValue['filename'])) {
34
                $fileName = $fieldValue['filename'];
35
            }
36
            if (isset($fieldValue['mime_type'])) {
37
                $mimeType = $fieldValue['mime_type'];
38
            }
39
        }
40
41
        // default format: path is relative to the 'files' dir
42
        $realFilePath = dirname($context['path']) . '/files/' . $filePath;

Core/ComplexField/EzImage.php 1 location

@@ 31-41 (lines=11) @@
28
29
        if ($fieldValue === null) {
30
            return new ImageValue();
31
        } else if (is_string($fieldValue)) {
32
            $filePath = $fieldValue;
33
        } else {
34
            $filePath = $fieldValue['path'];
35
            if (isset($fieldValue['alt_text'])) {
36
                $altText = $fieldValue['alt_text'];
37
            }
38
            if (isset($fieldValue['filename'])) {
39
                $fileName = $fieldValue['filename'];
40
            }
41
        }
42
43
        // default format: path is relative to the 'images' dir
44
        $realFilePath = dirname($context['path']) . '/images/' . $filePath;