/** * 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; }
private function checkFunc($function) { return RtHelper::check_array($function) OR RtHelper::check_closure($function) OR RtHelper::check_string($function); }