Skip to content

Commit

Permalink
[generate:module] Fixed dependencies validation (#4030)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjuarez20 authored and enzolutions committed May 10, 2019
1 parent 245767a commit 5a05088
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Utils/Validator.php
Expand Up @@ -16,6 +16,7 @@ class Validator
const REGEX_COMMAND_CLASS_NAME = '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]+Command$/';
const REGEX_CONTROLLER_CLASS_NAME = '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]+Controller$/';
const REGEX_MACHINE_NAME = '/^[a-z0-9_]+$/';
const REGEX_DEPENDENCY_NAME = '/^[a-z0-9_:]+$/';
// This REGEX remove spaces between words
const REGEX_REMOVE_SPACES = '/[\\s+]/';
// Max length to 32
Expand Down Expand Up @@ -177,7 +178,7 @@ public function validateMachineNameList($list)
$list = explode(',', $this->removeSpaces($list));
foreach ($list as $key => $module) {
if (!empty($module)) {
if (preg_match(self::REGEX_MACHINE_NAME, $module)) {
if (preg_match(self::REGEX_DEPENDENCY_NAME, $module)) {
$list_checked['success'][] = $module;
} else {
$list_checked['fail'][] = $module;
Expand Down

0 comments on commit 5a05088

Please sign in to comment.