| 1 | <?php |
||
| 7 | class RouterMapBuilder |
||
| 8 | { |
||
| 9 | |||
| 10 | private $routerConfig = []; |
||
| 11 | |||
| 12 | public function setRouterConfig(array $config) |
||
| 16 | |||
| 17 | public function build() |
||
| 28 | |||
| 29 | private function getRoutePathMap() |
||
| 36 | |||
| 37 | /** |
||
| 38 | * $handlers schema |
||
| 39 | * (string) $handlers method or function name | {closure} |
||
| 40 | * (array) $handlers['GET' | 'POST'] => method or function name | {closure} |
||
| 41 | * |
||
| 42 | * @param Map $routerMap |
||
| 43 | * @param string $path url path |
||
| 44 | * @param string|array|closure $handlers |
||
| 45 | */ |
||
| 46 | private function addRouterMap(Map $routerMap, $path, $handlers) |
||
| 56 | |||
| 57 | private function resolveHttpGetHandler($handlers) |
||
| 65 | |||
| 66 | private function resolveHttpPostHandler($handlers) |
||
| 70 | } |
||
| 71 |