protected function controller($route_body, &$item = "") { $controllerInspector = new ControllerInspector(); $controller_rules = "/(?<=get|post|any|put|delete)[\\S]*/"; $code = $this->getController($route_body['controller']); $methods = $code->getFunctions(); foreach ($methods as $method) { if (preg_match($controller_rules, $method->name, $match) && $method->isPublic()) { if (strstr("\\" . $method->class, $this->config)) { $route_body_tmp = $route_body; $route_body_tmp['route'] = $controllerInspector->getPlainUri($method->name, $route_body_tmp['route']); $route_body_tmp['method'] = $controllerInspector->getVerb($method->name); $function = $code->getDocument($method, $route_body_tmp['route']); $route_body_tmp = array_merge($route_body_tmp, $function); $item[$route_body_tmp['route']][$route_body_tmp['method']] = $route_body_tmp; } } } }