condition = $condition; } else { throw new InvalidArgumentException('The provided condition must be a callable or boolean.'); } } /** * Convert the rule to a validation string. * * @return string */ public function __toString() { if (is_callable($this->condition)) { return call_user_func($this->condition) ? 'exclude' : ''; } return $this->condition ? 'exclude' : ''; } }