Code Duplication    Length = 6-6 lines in 2 locations

htdocs/xoops_lib/Xmf/Yaml.php 2 locations

@@ 162-167 (lines=6) @@
159
        try {
160
            $lines = preg_split('/\R/', $yamlString);
161
            $count = count($lines);
162
            for ($index = $count; --$index > 0;) {
163
                if ('...' === $lines[$index]) {
164
                    array_splice($lines, $index);
165
                    break;
166
                }
167
            }
168
            $count = count($lines);
169
            for ($index = 0; ++$index < $count;) {
170
                if ('---' === $lines[$index]) {
@@ 169-174 (lines=6) @@
166
                }
167
            }
168
            $count = count($lines);
169
            for ($index = 0; ++$index < $count;) {
170
                if ('---' === $lines[$index]) {
171
                    array_splice($lines, 0, $index);
172
                    break;
173
                }
174
            }
175
            $unwrapped = implode("\n", $lines);
176
            $ret = VendorYaml::parse($unwrapped);
177
        } catch (\Exception $e) {