Code Duplication    Length = 6-6 lines in 2 locations

src/Parser/JsonParser.php 1 location

@@ 36-41 (lines=6) @@
33
                throw new ParserException("{$file->getRelativePathname()}: {$error}");
34
            }
35
36
            if (isset($parsed['entries'])) {
37
                $data += $parsed['entries'];
38
            } else {
39
                $id = str_replace(".{$file->getExtension()}", '', $file->getFilename());
40
                $data[$id] = $parsed;
41
            }
42
        }
43
44
        $data = $this->parseArrayData($data);

src/Parser/YamlParser.php 1 location

@@ 37-42 (lines=6) @@
34
            try {
35
                $parsed = Yaml::parse($file->getContents());
36
37
                if (isset($parsed['entries'])) {
38
                    $yamlData += $parsed['entries'];
39
                } else {
40
                    $id = str_replace(".{$file->getExtension()}", '', $file->getFilename());
41
                    $yamlData[$id] = $parsed;
42
                }
43
            } catch (ParseException $e) {
44
                throw new ParserException("{$file->getRelativePathname()}: {$e->getMessage()}");
45
            }