Code Duplication    Length = 12-12 lines in 2 locations

src/UserConfig.php 2 locations

@@ 58-69 (lines=12) @@
55
    )
56
    {
57
        foreach ($paths as $path) {
58
            foreach (glob($path . '*Command.php') as $file) {
59
                $classname = static::findClass($di, $file);
60
                if ($classname === '') {
61
                    break;
62
                }
63
64
                $command_name = strtolower(basename($classname, 'Command'));
65
                $dispatcher->setObject(
66
                    $command_name,
67
                    $di->lazyNew($classname)
68
                );
69
            }
70
71
            foreach (glob($path . '*CommandHelp.php') as $file) {
72
                $classname = static::findClass($di, $file);
@@ 71-82 (lines=12) @@
68
                );
69
            }
70
71
            foreach (glob($path . '*CommandHelp.php') as $file) {
72
                $classname = static::findClass($di, $file);
73
                if ($classname === '') {
74
                    break;
75
                }
76
77
                $command_name = strtolower(basename($classname, 'CommandHelp'));
78
                $help_service->set(
79
                    $command_name,
80
                    $di->lazyNew($classname)
81
                );
82
            }
83
        }
84
    }
85
}