Code Duplication    Length = 11-14 lines in 2 locations

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

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

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