Code Duplication    Length = 36-37 lines in 4 locations

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

@@ 146-182 (lines=37) @@
143
        return $ret;
144
    }
145
146
    protected function initFildset()
147
    {
148
        $this->paramList = array(
149
            'pluginCode' => array(
150
                'no' => 1,
151
                'label' => '[+]Plugin Code: ',
152
                'value' => null,
153
                'name' => '[+]Please enter Plugin Code (only pascal case letters numbers are allowed)',
154
                'validation' => array(
155
                    'isRequired' => true,
156
                    'inArray' => $this->getPluginList()
157
                )
158
            ),
159
            'tableList' => array(
160
                'no' => 2,
161
                'label' => '[+]Table name: ',
162
                'value' => array(),
163
                'name' => '[+]Please enter table name',
164
                'validation' => array(
165
                    'isRequired' => false,
166
                    'inArray' => $this->getTableList()
167
                )
168
            ),
169
            'supportFlag' => array(
170
                'no' => 3,
171
                'label' => '[+]Old version support: ',
172
                'value' => null,
173
                'name' => '[+]Do you want to support old versions too? [y/n]',
174
                'show' => array(
175
                    1 => 'Yes', 0 => 'No'),
176
                'validation' => array(
177
                    'isRequired' => true,
178
                    'choice' => array('y' => 1, 'n' => 0)
179
                )
180
            )
181
        );
182
    }
183
184
    private function getTableList()
185
    {

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

@@ 158-194 (lines=37) @@
155
        }
156
    }
157
158
    protected function initFildset()
159
    {
160
        $this->paramList = array(
161
            'pluginCode' => array(
162
                'no' => 1,
163
                 'label' => '[+]Plugin Code: ',
164
                'value' => null,
165
                'name' => '[+]Please enter Plugin Name (only pascal case letters numbers are allowed)',
166
                'validation' => array(
167
                    'isRequired' => true,
168
                    'inArray' => $this->getPluginList()
169
                )
170
            ),
171
            'entityList' => array(
172
                'no' => 2,
173
                'label' => '[+]Yaml file name: ',
174
                'value' => array(),
175
                'name' => '[+]Plese enter yaml file name',
176
                'validation' => array(
177
                    'isRequired' => false,
178
                    'inArray' => 'getEntityList'
179
                )
180
            ),
181
            'supportFlag' => array(
182
                'no' => 3,
183
                'label' => '[+]Old version support: ',
184
                'value' => null,
185
                'name' => '[+]Do you want to support old versions too? [y/n]',
186
                'show' => array(
187
                    1 => 'Yes', 0 => 'No'),
188
                'validation' => array(
189
                    'isRequired' => true,
190
                    'choice' => array('y' => 1, 'n' => 0)
191
                )
192
            )
193
        );
194
    }
195
196
    protected function getEntityList()
197
    {

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

@@ 55-90 (lines=36) @@
52
        $this->output->writeln('');
53
    }
54
55
    protected function initFieldSet()
56
    {
57
        $this->paramList = array(
58
            'pluginCode' => array(
59
                'no' => 1,
60
                'label' => '[+]Plugin Code: ',
61
                'value' => null,
62
                'name' => '[+]Please enter Plugin Code (First letter is uppercase alphabet only. alphabet and numbers are allowed.)',
63
                'validation' => array(
64
                    'isRequired' => true,
65
                    'isNotCode' => $this->getPluginCodes(),
66
                )
67
            ),
68
            'tableList' => array(
69
                'no' => 2,
70
                'label' => '[+]Table name: ',
71
                'value' => array(),
72
                'name' => '[+]Please enter table name',
73
                'validation' => array(
74
                    'isRequired' => false,
75
                    'inArray' => $this->getTableList(),
76
                )
77
            ),
78
            'supportFlag' => array(
79
                'no' => 3,
80
                'label' => '[+]Old version support: ',
81
                'value' => null,
82
                'name' => '[+]Do you want to support old versions too? [y/n]',
83
                'show' => array(1 => 'Yes', 0 => 'No'),
84
                'validation' => array(
85
                    'isRequired' => true,
86
                    'choice' => array('y' => 1, 'n' => 0),
87
                )
88
            )
89
        );
90
    }
91
92
    /**
93
     * プラグイン用テーブル一覧(plg_xxxx)の取得

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

@@ 52-87 (lines=36) @@
49
        $this->output->writeln('');
50
    }
51
52
    protected function initFieldSet()
53
    {
54
        $this->paramList = array(
55
            'pluginCode' => array(
56
                'no' => 1,
57
                'label' => '[+]Plugin Code: ',
58
                'value' => null,
59
                'name' => '[+]Please enter Plugin Code (First letter is uppercase alphabet only. alphabet and numbers are allowed.)',
60
                'validation' => array(
61
                    'isRequired' => true,
62
                    'isNotCode' => $this->getPluginCodes(),
63
                )
64
            ),
65
            'ymlList' => array(
66
                'no' => 2,
67
                'label' => '[+]Yml file name: ',
68
                'value' => array(),
69
                'name' => '[+]Plese enter yml file name',
70
                'validation' => array(
71
                    'isRequired' => false,
72
                    'inArray' => 'getYamlList',
73
                )
74
            ),
75
            'supportFlag' => array(
76
                'no' => 3,
77
                'label' => '[+]Old version support: ',
78
                'value' => null,
79
                'name' => '[+]Do you want to support old versions too? [y/n]',
80
                'show' => array(1 => 'Yes', 0 => 'No'),
81
                'validation' => array(
82
                    'isRequired' => true,
83
                    'choice' => array('y' => 1, 'n' => 0),
84
                )
85
            )
86
        );
87
    }
88
89
    protected function getYamlList()
90
    {