src/Modules/Validation/Validator.php
public function validate($value, array $rules)
    {
        $errors = [];
        $value  = trim($value);

        foreach ($rules as $rule) {
            list($rule_normalized, $rule_extended) = [$rule, null];
            if (is_array($rule)) {
                list($rule_normalized, $rule_extended) = $rule;
            }

            if (!$this->checkRule($rule_normalized, $value, $rule_extended)) {
                $errors[] = $rule_normalized;
            }
        }

        return $errors;
    }
public function validate($value, array $rules)
    {
        $errors = [];
        $value  = trim($value);

        foreach ($rules as $rule) {
            list($rule_normalized, $rule_extended) = [$rule, null];
            if (is_array($rule)) {
                list($rule_normalized, $rule_extended) = $rule;
            }

            if (!$this->checkRule($rule_normalized, $value, $rule_extended)) {
                $errors[] = $rule_normalized;
            }
        }

        return $errors;
    }
@param string $value
@param array  $rules

@throws \InvalidArgumentException

@return array