Code Duplication    Length = 7-7 lines in 3 locations

src/build/Agavi/Build/Console/Command/ModuleCreate.php 3 locations

@@ 121-127 (lines=7) @@
118
                }, $defaultParams);
119
        }
120
        @mkdir($projectLocation . '/app/modules/' . $module . '/lib/model', 0755, true);
121
        foreach (glob($this->getSourceDir() . '/build/templates/app/modules/lib/model/*.tmpl') as $file) {
122
            $fc->copy($file, $projectLocation . '/app/modules/' . $module . '/lib/model/' . $settings['project']['prefix'] . $module . basename($file, '.tmpl'),
123
                function ($data, $params) {
124
                    return $this->moduleTokenReplacer($data, $params);
125
                }, $defaultParams);
126
        }
127
        @mkdir($projectLocation . '/app/modules/' . $module . '/lib/view', 0755, true);
128
        foreach (glob($this->getSourceDir() . '/build/templates/app/modules/lib/view/*.tmpl') as $file) {
129
            $fc->copy($file, $projectLocation . '/app/modules/' . $module . '/lib/view/' . $settings['project']['prefix'] . $module . basename($file, '.tmpl'),
130
                function ($data, $params) {
@@ 114-120 (lines=7) @@
111
112
        // Lib
113
        @mkdir($projectLocation . '/app/modules/' . $module . '/lib/controller', 0755, true);
114
        foreach (glob($this->getSourceDir() . '/build/templates/app/modules/lib/controller/*.tmpl') as $file) {
115
            $fc->copy($file, $projectLocation . '/app/modules/' . $module . '/lib/controller/' . $settings['project']['prefix'] . $module . basename($file, '.tmpl'),
116
                function ($data, $params) {
117
                    return $this->moduleTokenReplacer($data, $params);
118
                }, $defaultParams);
119
        }
120
        @mkdir($projectLocation . '/app/modules/' . $module . '/lib/model', 0755, true);
121
        foreach (glob($this->getSourceDir() . '/build/templates/app/modules/lib/model/*.tmpl') as $file) {
122
            $fc->copy($file, $projectLocation . '/app/modules/' . $module . '/lib/model/' . $settings['project']['prefix'] . $module . basename($file, '.tmpl'),
123
                function ($data, $params) {
@@ 128-134 (lines=7) @@
125
                }, $defaultParams);
126
        }
127
        @mkdir($projectLocation . '/app/modules/' . $module . '/lib/view', 0755, true);
128
        foreach (glob($this->getSourceDir() . '/build/templates/app/modules/lib/view/*.tmpl') as $file) {
129
            $fc->copy($file, $projectLocation . '/app/modules/' . $module . '/lib/view/' . $settings['project']['prefix'] . $module . basename($file, '.tmpl'),
130
                function ($data, $params) {
131
                    return $this->moduleTokenReplacer($data, $params);
132
                }, $defaultParams);
133
        }
134
    }
135
136
    public function moduleTokenReplacer($data, $params)
137
    {