Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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);
 }