Code Duplication    Length = 4-4 lines in 2 locations

Core/FieldHandler/EzRichText.php 1 location

@@ 45-48 (lines=4) @@
42
        $count = preg_match_all($regexp, $xmlText, $matches);
43
        // $matches[0][] will have the matched full string eg.: [reference:example_reference]
44
        if ($count) {
45
            foreach ($matches[0] as $referenceIdentifier) {
46
                $reference = $this->resolver->getReferenceValue(substr($referenceIdentifier, 1, -1));
47
                $xmlText = str_replace($referenceIdentifier, $reference, $xmlText);
48
            }
49
        }
50
51
        return $xmlText;

Core/FieldHandler/EzXmlText.php 1 location

@@ 49-52 (lines=4) @@
46
        $count = preg_match_all($regexp, $xmlText, $matches);
47
        // $matches[0][] will have the matched full string eg.: [reference:example_reference]
48
        if ($count) {
49
            foreach ($matches[0] as $referenceIdentifier) {
50
                $reference = $this->resolver->getReferenceValue(substr($referenceIdentifier, 1, -1));
51
                $xmlText = str_replace($referenceIdentifier, $reference, $xmlText);
52
            }
53
        }
54
55
        return $xmlText;