private static function services($methods) { $result = array(); foreach ($methods as $methodName => $method) { if (!$method instanceof \Closure) { $params = array(); if (is_array($method)) { $template = array_shift($method); $params = $method; } else { $template = $method; } $result[$methodName] = ar_pinp::getCallback($template, $params); } else { $result[$methodName] = $method; } } return $result; }
public static function registerValidateCheck($name, $check, $message) { if (!is_string($check) || $check[0] != '/' && !is_callable($check)) { $check = ar_pinp::getCallback($check, array('value')); } self::$checks[$name] = array('check' => $check, 'message' => $message); }
public function call($method, $args = array()) { if (is_string($method)) { $method = ar_pinp::getCallback($method, array_keys($args)); } if (!$method instanceof \Closure) { return ar_error::raiseError('Illegal event listener method', 500); } return ar_events::addListener($this->path, $this->eventName, $this->objectType, $method, $args, $this->capture, $this->filters); }