src/Validation/Validation.php
protected function fetchValidator($validator)
    {
        if (!is_object($validator)) {
            if (is_array($validator)) {
                $name = array_shift($validator);

                $args = $validator;
            } else {
                $parts = explode(':', $validator, 2);

                $name = array_shift($parts);

                $args = $parts ? explode(',', array_shift($parts)) : [];
            }

            $className = $this->getClassByName($name);

            $validator = new $className(...$args);
        }

        if (!($validator instanceof ValidatorStrategy)) {
            throw new ValidationException('Validator `' . get_class($validator) . '` should be an instance of `' . ValidatorStrategy::class . '`.');
        }

        return $validator;
    }
protected function fetchValidator($validator)
    {
        if (!is_object($validator)) {
            if (is_array($validator)) {
                $name = array_shift($validator);

                $args = $validator;
            } else {
                $parts = explode(':', $validator, 2);

                $name = array_shift($parts);

                $args = $parts ? explode(',', array_shift($parts)) : [];
            }

            $className = $this->getClassByName($name);

            $validator = new $className(...$args);
        }

        if (!($validator instanceof ValidatorStrategy)) {
            throw new ValidationException('Validator `' . get_class($validator) . '` should be an instance of `' . ValidatorStrategy::class . '`.');
        }

        return $validator;
    }
@param $validator

@throws ValidationException

@return ValidatorStrategy