Code Duplication    Length = 8-10 lines in 7 locations

src/Kunstmaan/GeneratorBundle/Command/KunstmaanGenerateCommand.php 7 locations

@@ 707-715 (lines=9) @@
704
    ) {
705
        $fields = [];
706
        switch ($type) {
707
            case 'single_line':
708
                $fields[$type][] = [
709
                    'fieldName' => lcfirst(Container::camelize($name)),
710
                    'type' => 'string',
711
                    'length' => '255',
712
                    'formType' => TextType::class,
713
                    'nullable' => $allNullable,
714
                ];
715
716
                break;
717
            case 'multi_line':
718
                $fields[$type][] = [
@@ 717-724 (lines=8) @@
714
                ];
715
716
                break;
717
            case 'multi_line':
718
                $fields[$type][] = [
719
                    'fieldName' => lcfirst(Container::camelize($name)),
720
                    'type' => 'text',
721
                    'formType' => TextareaType::class,
722
                    'nullable' => $allNullable,
723
                ];
724
725
                break;
726
            case 'wysiwyg':
727
                $fields[$type][] = [
@@ 726-733 (lines=8) @@
723
                ];
724
725
                break;
726
            case 'wysiwyg':
727
                $fields[$type][] = [
728
                    'fieldName' => lcfirst(Container::camelize($name)),
729
                    'type' => 'text',
730
                    'formType' => WysiwygType::class,
731
                    'nullable' => $allNullable,
732
                ];
733
734
                break;
735
            case 'link':
736
                foreach (['url', 'text'] as $subField) {
@@ 846-853 (lines=8) @@
843
                ];
844
845
                break;
846
            case 'boolean':
847
                $fields[$type][] = [
848
                    'fieldName' => lcfirst(Container::camelize($name)),
849
                    'type' => 'boolean',
850
                    'formType' => CheckboxType::class,
851
                    'nullable' => $allNullable,
852
                ];
853
854
                break;
855
            case 'integer':
856
                $fields[$type][] = [
@@ 855-862 (lines=8) @@
852
                ];
853
854
                break;
855
            case 'integer':
856
                $fields[$type][] = [
857
                    'fieldName' => lcfirst(Container::camelize($name)),
858
                    'type' => 'integer',
859
                    'formType' => IntegerType::class,
860
                    'nullable' => $allNullable,
861
                ];
862
863
                break;
864
            case 'decimal':
865
                $fields[$type][] = [
@@ 864-873 (lines=10) @@
861
                ];
862
863
                break;
864
            case 'decimal':
865
                $fields[$type][] = [
866
                    'fieldName' => lcfirst(Container::camelize($name)),
867
                    'type' => 'decimal',
868
                    'precision' => 10,
869
                    'scale' => 2,
870
                    'formType' => NumberType::class,
871
                    'nullable' => $allNullable,
872
                ];
873
874
                break;
875
            case 'datetime':
876
                $fields[$type][] = [
@@ 875-882 (lines=8) @@
872
                ];
873
874
                break;
875
            case 'datetime':
876
                $fields[$type][] = [
877
                    'fieldName' => lcfirst(Container::camelize($name)),
878
                    'type' => 'datetime',
879
                    'formType' => DateTimeType::class,
880
                    'nullable' => $allNullable,
881
                ];
882
883
                break;
884
        }
885