Code Duplication    Length = 11-15 lines in 3 locations

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::create()->string()->alphaNumeric()->noWhitespace()
39
        );
40
41
        $this->getDefinition()->addArgument($model);
42
43
        return $this;
44
    }
45
46
    /**
47
     * Required for correct mock it

src/Command/AbstractCommand.php 2 locations

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