Code Duplication    Length = 17-20 lines in 2 locations

src/Parsers/ExtendedJsonParser.php 1 location

@@ 77-96 (lines=20) @@
74
     *
75
     * @return string The parsed configuration as string
76
     */
77
    public function parse(string $installationDir, string $defaultConfigurationDir, array $directories) : string
78
    {
79
80
        // initialize the array that'll contain the configuration structure
81
        $main = array();
82
83
        // iterate over the found directories to parse them for configuration files
84
        foreach ($directories as $directory) {
85
            $this->process($main, $directory);
86
        }
87
88
        // process the configuration of the extension libaries, if available
89
        $this->processExtensionLibraries($main, $defaultConfigurationDir);
90
91
        // process the additional vendor directories, if available
92
        $this->processAdditionalVendorDirs($main, $installationDir, $defaultConfigurationDir);
93
94
        // return the JSON encoded configuration
95
        return json_encode($main, JSON_PRETTY_PRINT);
96
    }
97
98
    /**
99
     * Process the configuration files found in the extension libary directories

src/Parsers/JsonParser.php 1 location

@@ 94-110 (lines=17) @@
91
     *
92
     * @return string The parsed configuration as string
93
     */
94
    public function parse(string $installationDir, string $defaultConfigurationDir, array $directories) : string
95
    {
96
97
        // initialize the array that'll contain the configuration structure
98
        $main = array();
99
100
        // iterate over the found directories to parse them for configuration files
101
        foreach ($directories as $directory) {
102
            $this->process($main, $directory);
103
        }
104
105
        // process the additional vendor directories, if available
106
        $this->processAdditionalVendorDirs($main, $installationDir, $defaultConfigurationDir);
107
108
        // return the JSON encoded configuration
109
        return json_encode($main, JSON_PRETTY_PRINT);
110
    }
111
112
    /**
113
     * Process the passed directory and merges/replaces the found