public function apply(Rule $rule, $value)
{
$type = $rule->getInputType();
if ($type == CallbackRule::SELF_METHOD_TYPE) {
return $this->useObjectMethod($rule->callback, $value);
}
if ($type == CallbackRule::CALLABLE_TYPE) {
return $this->useCallable($rule->callback, $value);
}
if ($type == CallbackRule::CLOSURE_TYPE) {
return $this->useClosure($rule->callback, $value);
}
throw new InvalidCallbackException("Unsupported callback provided, failed to filter property");
}