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