Code Duplication    Length = 12-12 lines in 2 locations

src/controllers/DumpController.php 2 locations

@@ 27-38 (lines=12) @@
24
     * Dump defined components.
25
     * @param string $name component name
26
     */
27
    public function actionComponent($name = null)
28
    {
29
        $data = Yii::$app->getComponents();
30
        if ($name) {
31
            if (empty($data[$name])) {
32
                Yii::error("'$name' not defined");
33
                return;
34
            }
35
            $data = [$name => $data[$name]];
36
        }
37
        echo Yaml::dump($data, 4);
38
    }
39
40
    /**
41
     * Dump defined controllers.
@@ 44-55 (lines=12) @@
41
     * Dump defined controllers.
42
     * @param string $name controller name
43
     */
44
    public function actionController($name = null)
45
    {
46
        $data = Yii::$app->controllerMap;
47
        if ($name) {
48
            if (empty($data[$name])) {
49
                Yii::error("'$name' not defined");
50
                return;
51
            }
52
            $data = [$name => $data[$name]];
53
        }
54
        echo Yaml::dump($data, 4);
55
    }
56
57
    /**
58
     * Dump defined aliases.