Code Duplication    Length = 11-15 lines in 3 locations

src/Command/AbstractCommand.php 2 locations

@@ 171-181 (lines=11) @@
168
     * @param int $required
169
     * @return AbstractCommand
170
     */
171
    protected function addModuleArgument($required = InputArgument::REQUIRED)
172
    {
173
        $module = new InputArgument('module', $required, 'Module name is required');
174
        $module->setValidator(
175
            v::string()->alphaNumeric('-_')->noWhitespace()
176
        );
177
178
        $this->getDefinition()->addArgument($module);
179
180
        return $this;
181
    }
182
183
    /**
184
     * addControllerArgument
@@ 189-203 (lines=15) @@
186
     * @param int $required
187
     * @return AbstractCommand
188
     */
189
    protected function addControllerArgument($required = InputArgument::REQUIRED)
190
    {
191
        $controller = new InputArgument(
192
            'controller',
193
            $required,
194
            'Controller name is required'
195
        );
196
        $controller->setValidator(
197
            v::string()->alphaNumeric('-_')->noWhitespace()
198
        );
199
200
        $this->getDefinition()->addArgument($controller);
201
202
        return $this;
203
    }
204
}
205

src/Command/Generate/AbstractGenerateCommand.php 1 location

@@ 34-44 (lines=11) @@
31
     *
32
     * @return self
33
     */
34
    protected function addModelArgument()
35
    {
36
        $model = new InputArgument('model', InputArgument::REQUIRED, 'Model name is required');
37
        $model->setValidator(
38
            v::string()->alphaNumeric()->noWhitespace()
39
        );
40
41
        $this->getDefinition()->addArgument($model);
42
43
        return $this;
44
    }
45
46
    /**
47
     * Required for correct mock it