Code Duplication    Length = 11-11 lines in 2 locations

src/build/Agavi/Build/Console/Command/ControllerCreate.php 1 location

@@ 400-410 (lines=11) @@
397
     * @param string $controllerName the controller name
398
     * @return string the generated execute-methods
399
     */
400
    private function generateHandleOutputTypeMethods(array $output_types, string $controllerName)
401
    {
402
        $tmpl = file_get_contents($this->getSourceDir() . '/build/templates/code/views/HandleOutputType.tmpl');
403
404
        $code = '';
405
        foreach ($output_types as $output_type) {
406
            $code .= str_replace(['%%OUTPUT_TYPE_NAME%%', '%%CONTROLLER_NAME%%'], [ucfirst($output_type), $controllerName], $tmpl);
407
        }
408
        return $code;
409
    }
410
411
    private function writeSettings($file, $xpath, $value, OutputInterface $output)
412
    {
413
        $document = new \DOMDocument();

src/build/Agavi/Build/Console/Command/ViewCreate.php 1 location

@@ 193-203 (lines=11) @@
190
     * @param string $controllerName the controller name
191
     * @return string the generated execute-methods
192
     */
193
    private function generateHandleOutputTypeMethods(array $output_types, string $controllerName)
194
    {
195
        $tmpl = file_get_contents($this->getSourceDir() . '/build/templates/code/views/HandleOutputType.tmpl');
196
197
        $code = '';
198
        foreach ($output_types as $output_type) {
199
            $code .= str_replace(['%%OUTPUT_TYPE_NAME%%', '%%CONTROLLER_NAME%%'], [ucfirst($output_type), $controllerName], $tmpl);
200
        }
201
        return $code;
202
    }
203
}
204