diff --git a/src/Validator/ModelValidator.php b/src/Validator/ModelValidator.php index c78fe38..4d582cf 100644 --- a/src/Validator/ModelValidator.php +++ b/src/Validator/ModelValidator.php @@ -31,7 +31,7 @@ public function validate($object, string $validationRequiredType = '') { throw new \InvalidArgumentException('Invalid object supplied for validation.'); } - $this->loadRules(__DIR__ . '\Rules'); + $this->loadRules(__DIR__ . DIRECTORY_SEPARATOR . 'Rules'); $modelClass = new ModelClass($object); foreach($modelClass->getProperties() as $property) { @@ -44,7 +44,7 @@ public function validate($object, string $validationRequiredType = '') { * @param string $location */ public function loadRules(string $location) { - $files = glob($location . '\*.php'); + $files = glob($location . DIRECTORY_SEPARATOR . '*.php'); foreach($files as $file) { @require_once $file; $filename = basename($file, ".php");