public function __call($name, $arguments) { if (RtHelper::checkHTTPMethod($name)) { if (isset($arguments[0])) { return $this->store($name, $arguments[0]); } } elseif (RtHelper::checkDecorator($name)) { if (isset($arguments[0])) { return $this->decorate($name, $arguments[0]); } else { return $this->decorate($name); } } }
/** * 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; }
public function getType() { if (isset($this->request['route'])) { $route = $this->request['route']; if (is_string($route) && !empty($route)) { if (preg_match("/\.(.*)$/i", $route, $type)) { if (is_array($type) && isset($type[0])) { $found_type = strtolower(str_replace('.', '', $type[0])); if (RtHelper::checkType($found_type)) { return $found_type; } } } } } }