Code Duplication    Length = 16-16 lines in 2 locations

src/Eccube/Command/GeneratorCommand/AbstractPluginGenerator.php 1 location

@@ 434-449 (lines=16) @@
431
            $tmp[] = '    {';
432
            $tmp[] = '        $table = $schema->createTable(\''.$metadata->table['name'].'\');';
433
            $columns = $metadata->fieldMappings;
434
            foreach ($columns as $column) {
435
436
                $typeName = $column['type'];
437
                $tmp[] = '        $table->addColumn(\''.$column['columnName'].'\', \''.$typeName.'\', array(';
438
                $param = array();
439
                if (isset($column['nullable']) && $column['nullable']) {
440
                    $param['notnull'] = 'true';
441
                } else {
442
                    $param['notnull'] = 'false';
443
                }
444
445
                foreach ($param as $parKey => $parVal) {
446
                    $tmp[] = '            \''.$parKey.'\' => '.$parVal.',';
447
                }
448
                $tmp[] = '        ));';
449
            }
450
451
452
            $tmp[] = '    }';

src/Eccube/Command/PluginCommand/EntityFromYamlGenerator.php 1 location

@@ 342-357 (lines=16) @@
339
            $tmp[] = '    {';
340
            $tmp[] = '        $table = $schema->createTable(\'' . $metadata->table['name'] . '\');';
341
            $columns = $metadata->fieldMappings;
342
            foreach ($columns as $column) {
343
344
                $typeName = $column['type'];
345
                $tmp[] = '        $table->addColumn(\'' . $column['columnName'] . '\', \'' . $typeName . '\', array(';
346
                $param = array();
347
                if (isset($column['nullable']) && $column['nullable']) {
348
                    $param['notnull'] = 'true';
349
                } else {
350
                    $param['notnull'] = 'false';
351
                }
352
353
                foreach ($param as $parKey => $parVal) {
354
                    $tmp[] = '            \'' . $parKey . '\' => ' . $parVal . ',';
355
                }
356
                $tmp[] = '        ));';
357
            }
358
359
360
            $tmp[] = '    }';