示例#1
0
 /**
  * Run provided function with its arguments and return derived result
  * 
  * @return mixed
  */
 public function perform() {
     if (RtHelper::check_closure($this->function)) {
         if ($this->args) {
             $result = call_user_func_array(
                     array($this->function, '__invoke'), $this->args);
         } else {
             $function = $this->function;
             $result = $function();
         }
     } else if (RtHelper::check_array($this->function)
             || RtHelper::check_string($this->function)) {
         if ($this->args) {
             $result = call_user_func_array($this->function, $this->args);
         } else {
             $result = call_user_func($this->function);
         }
     }
     return $result;
 }
示例#2
0
文件: rt.php 项目: nmtitov/routiny
 private function checkFunc($function) {
     return RtHelper::check_array($function)
     OR RtHelper::check_closure($function)
     OR RtHelper::check_string($function);
 }