Code Duplication    Length = 11-14 lines in 2 locations

lib/Doctrine/DBAL/Migrations/Configuration/JsonConfiguration.php 1 location

@@ 36-46 (lines=11) @@
33
    /**
34
     * @inheritdoc
35
     */
36
    protected function doLoad($file)
37
    {
38
        $config = json_decode(file_get_contents($file), true);
39
40
        if (isset($config['migrations_directory'])) {
41
            $config['migrations_directory'] = $this->getDirectoryRelativeToFile($file, $config['migrations_directory']);
42
        }
43
44
        $this->setConfiguration($config);
45
46
    }
47
}
48

lib/Doctrine/DBAL/Migrations/Configuration/YamlConfiguration.php 1 location

@@ 37-50 (lines=14) @@
34
    /**
35
     * @inheritdoc
36
     */
37
    protected function doLoad($file)
38
    {
39
        $config = Yaml::parse(file_get_contents($file));
40
41
        if (!is_array($config)) {
42
            throw new \InvalidArgumentException('Not valid configuration.');
43
        }
44
45
        if (isset($config['migrations_directory'])) {
46
            $config['migrations_directory'] = $this->getDirectoryRelativeToFile($file, $config['migrations_directory']);
47
        }
48
49
        $this->setConfiguration($config);
50
    }
51
}
52