20 public static function parseRouteArray(&$result, $callable, $routeArray, \ReflectionFunction $function, $prefix =
"", $httpMethods = NULL) {
22 $name = $routeArray [
"name"];
23 if (! isset ( $name )) {
24 $name = UString::cleanAttribute ( $pathParameters );
26 $cache = $routeArray [
"cache"];
27 $duration = $routeArray [
"duration"];
28 $path = $pathParameters [
"path"];
29 $parameters = $pathParameters [
"parameters"];
30 $priority = $routeArray [
"priority"];
32 if (isset ( $routeArray [
"methods"] ) && \is_array ( $routeArray [
"methods"] )) {
33 self::createRouteMethod ( $result, $callable, $path, $routeArray [
"methods"], $parameters, $name, $cache, $duration, $priority );
34 } elseif (\is_array ( $httpMethods )) {
35 self::createRouteMethod ( $result, $callable, $path, $httpMethods, $parameters, $name, $cache, $duration, $priority );
37 $result [$path] = [
"controller" => $callable,
"action" =>
"",
"parameters" => $parameters,
"name" => $name,
"cache" => $cache,
"duration" => $duration,
"priority" => $priority ];
41 private static function createRouteMethod(&$result, $callable, $path, $httpMethods, $parameters, $name, $cache, $duration, $priority) {
42 foreach ( $httpMethods as $httpMethod ) {
43 $result [$path] [$httpMethod] = [
"controller" => $callable,
"action" =>
"",
"parameters" => $parameters,
"name" => $name,
"cache" => $cache,
"duration" => $duration,
"priority" => $priority ];