public function __call($method, $arguments = array())
{
if (in_array($method, $this->rules)) {
// check if closer exists allowing methods to be overwritten
if (isset($this->closures[$method])) {
return call_user_func_array($this->closures[$method], $arguments);
} else {
if (in_array($method, get_class_methods($this))) {
// check if function is a class method, if it is then execute it
return call_user_func_array(array($this, $method), $arguments);
} else {
throw new Exception('Unknown Function "' . $method . '" in RuleList');
}
}
} else {
throw new Exception('Unknown Function "' . $method . '" in RuleList');
}
}