Code Duplication    Length = 6-6 lines in 2 locations

src/provider/YamlProvider.php 1 location

@@ 25-30 (lines=6) @@
22
            try {
23
                $parsed = Yaml::parse($file->getContents());
24
25
                if (isset($parsed['entries'])) {
26
                    $data += $parsed['entries'];
27
                } else {
28
                    $id = str_replace(".{$file->getExtension()}", '', $file->getFilename());
29
                    $data[$id] = $parsed;
30
                }
31
            } catch (ParseException $e) {
32
                throw new ProviderException("{$file->getRelativePathname()}: {$e->getMessage()}");
33
            }

src/provider/JsonProvider.php 1 location

@@ 26-31 (lines=6) @@
23
                throw new ProviderException("{$file->getRelativePathname()}: {$error}");
24
            }
25
26
            if (isset($parsed['entries'])) {
27
                $data += $parsed['entries'];
28
            } else {
29
                $id = str_replace(".{$file->getExtension()}", '', $file->getFilename());
30
                $data[$id] = $parsed;
31
            }
32
        }
33
34
        $data = $this->parseArrayData($data);