diff --git a/src/Support/Storage/ValidateConfig.php b/src/Support/Storage/ValidateConfig.php index a987f882f59640cac02c6e7fcecfc0f16735ffcc..d12af0ccb75ab76078e2a84dcb660486301cbcfc 100644 --- a/src/Support/Storage/ValidateConfig.php +++ b/src/Support/Storage/ValidateConfig.php @@ -134,7 +134,7 @@ final class ValidateConfig } /** - * Set the custom rules namespace prefix, If more than one exists, they all take effect + * Set the custom rule namespace prefix, If more than one exists, they all take effect * * @link https://v.neww7.com/en/4/Rule.html#pre-processing * @param string $rulesPath Custom rules namespace prefixes @@ -142,6 +142,9 @@ final class ValidateConfig */ public function setRulesPath(string $rulesPath): ValidateConfig { + if ('\\' !== substr($rulesPath, -1)) { + $rulesPath = $rulesPath . '\\'; + } $this->rulesPath[] = $rulesPath; $this->rulesPath = array_unique($this->rulesPath); return $this;