Code Duplication    Length = 14-14 lines in 3 locations

src/Command/AbstractCommand.php 2 locations

@@ 194-207 (lines=14) @@
191
     * @return void
192
     * @throws \Bluzman\Input\InputException
193
     */
194
    protected function validateModuleArgument() : void
195
    {
196
        $module = $this->getInput()->getArgument('module');
197
198
        $validator = Validator::create()
199
            ->string()
200
            ->alphaNumeric('-_')
201
            ->noWhitespace();
202
203
        if ($this->getDefinition()->getArgument('module')->isRequired()
204
            && !$validator->validate($module)) {
205
            throw new InputException($validator->getError());
206
        }
207
    }
208
209
    /**
210
     * Add Controller Argument
@@ 227-240 (lines=14) @@
224
     * @return void
225
     * @throws \Bluzman\Input\InputException
226
     */
227
    protected function validateControllerArgument() : void
228
    {
229
        $controller = $this->getInput()->getArgument('controller');
230
231
        $validator = Validator::create()
232
            ->string()
233
            ->alphaNumeric('-_')
234
            ->noWhitespace();
235
236
        if ($this->getDefinition()->getArgument('controller')->isRequired()
237
            && !$validator->validate($controller)) {
238
            throw new InputException($validator->getError());
239
        }
240
    }
241
}
242

src/Command/Generate/AbstractGenerateCommand.php 1 location

@@ 95-108 (lines=14) @@
92
     * @return void
93
     * @throws \Bluzman\Input\InputException
94
     */
95
    protected function validateTableArgument() : void
96
    {
97
        $table = $this->getInput()->getArgument('table');
98
99
        $validator = Validator::create()
100
            ->string()
101
            ->alphaNumeric('_')
102
            ->noWhitespace();
103
104
        if ($this->getDefinition()->getArgument('table')->isRequired()
105
            && !$validator->validate($table)) {
106
            throw new InputException($validator->getError());
107
        }
108
    }
109
110
    /**
111
     * Get Table instance