Code Duplication    Length = 7-7 lines in 3 locations

src/Hal/Application/Config/Parser.php 3 locations

@@ 21-27 (lines=7) @@
18
        }
19
20
        // Checking for a configuration file option key and importing options
21
        foreach ($argv as $k => $arg) {
22
            if (preg_match('!\-\-config=(.*)!', $arg, $matches)) {
23
                $fileReader = ConfigFileReaderFactory::createFromFileName($matches[1]);
24
                $fileReader->read($config);
25
                unset($argv[$k]);
26
            }
27
        }
28
29
        // arguments with options
30
        foreach ($argv as $k => $arg) {
@@ 30-36 (lines=7) @@
27
        }
28
29
        // arguments with options
30
        foreach ($argv as $k => $arg) {
31
            if (preg_match('!\-\-([\w\-]+)=(.*)!', $arg, $matches)) {
32
                list(, $parameter, $value) = $matches;
33
                $config->set($parameter, trim($value, ' "\''));
34
                unset($argv[$k]);
35
            }
36
        }
37
38
        // arguments without options
39
        foreach ($argv as $k => $arg) {
@@ 39-45 (lines=7) @@
36
        }
37
38
        // arguments without options
39
        foreach ($argv as $k => $arg) {
40
            if (preg_match('!\-\-([\w\-]+)$!', $arg, $matches)) {
41
                list(, $parameter) = $matches;
42
                $config->set($parameter, true);
43
                unset($argv[$k]);
44
            }
45
        }
46
47
        // last argument
48
        $files = array_pop($argv);