Code Duplication    Length = 13-17 lines in 2 locations

src/Filesystem/EnvironmentLoader.php 1 location

@@ 41-57 (lines=17) @@
38
    /**
39
     * @param WorkingDirectory $currentDirectory
40
     */
41
    public function load(WorkingDirectory $currentDirectory)
42
    {
43
        $loader = new Dotenv($currentDirectory->getCurrentDirectoryAbsolute());
44
45
        try {
46
            $loader->load();
47
        } catch (InvalidPathException $e) {
48
            if ($this->skipMissing === false) {
49
                throw $e;
50
            }
51
52
            // assuming .env file is missing here and then just proceed to check global env variables
53
        }
54
55
        $loader->required(self::MANDATORY_ENV_VARIABLES)
56
               ->notEmpty();
57
    }
58
}
59

src/Filesystem/SilentEnvironmentLoader.php 1 location

@@ 18-30 (lines=13) @@
15
    /**
16
     * @param WorkingDirectory $currentDirectory
17
     */
18
    public function load(WorkingDirectory $currentDirectory)
19
    {
20
        $loader = new Dotenv($currentDirectory->getCurrentDirectoryAbsolute());
21
22
        try {
23
            $loader->load();
24
        } catch (InvalidPathException $e) {
25
            // assuming .env file is missing here and then just proceed to check global env variables
26
        }
27
28
        $loader->required(EnvironmentLoader::MANDATORY_ENV_VARIABLES)
29
               ->notEmpty();
30
    }
31
}
32