src/RuleManager.php
private function validateRule($rule): bool
    {
        if ($rule instanceof \Closure || $rule instanceof RuleInterface) {
            return true;
        }

        if (is_array($rule)) {
            return is_callable($rule, true);
        }

        if (is_string($rule) && class_exists($rule)) {
            try {
                $reflection = new \ReflectionClass($rule);
            } catch (\ReflectionException $e) {
                return false;
            }

            return $reflection->isSubclassOf(RuleInterface::class);
        }

        return false;
    }
private function validateRule($rule): bool
    {
        if ($rule instanceof \Closure || $rule instanceof RuleInterface) {
            return true;
        }

        if (is_array($rule)) {
            return is_callable($rule, true);
        }

        if (is_string($rule) && class_exists($rule)) {
            try {
                $reflection = new \ReflectionClass($rule);
            } catch (\ReflectionException $e) {
                return false;
            }

            return $reflection->isSubclassOf(RuleInterface::class);
        }

        return false;
    }
private function validateRule ( $ rule ) : bool { if ( $ rule instanceof \ Closure || $ rule instanceof RuleInterface ) { return true ; } if ( is_array ( $ rule ) ) { return is_callable ( $ rule , true ) ; } if ( is_string ( $ rule ) && class_exists ( $ rule ) ) { try { $ reflection = new \ ReflectionClass ( $ rule ) ; } catch ( \ ReflectionException $ e ) { return false ; } return $ reflection -> isSubclassOf ( RuleInterface :: class ) ; } return false ; }
Must return true if rule is valid.

@param mixed $rule
@return bool
Must return true if rule is valid .