DefinedRouteCollector example

'controller' => $router->controllerName(),
                'method'     => $router->methodName(),
                'paramCount' => count($router->params()),
                'truePCount' => count($params),
                'params'     => $params,
            ],
        ];

        // Defined Routes         $routes = [];

        $definedRouteCollector = new DefinedRouteCollector($rawRoutes);

        foreach ($definedRouteCollector->collect() as $route) {
            // filter for strings, as callbacks aren't displayable             if ($route['handler'] !== '(Closure)') {
                $routes[] = [
                    'method'  => strtoupper($route['method']),
                    'route'   => $route['route'],
                    'handler' => $route['handler'],
                ];
            }
        }

        
'delete',
            'options',
            'trace',
            'connect',
            'cli',
        ];

        $tbody           = [];
        $uriGenerator    = new SampleURIGenerator();
        $filterCollector = new FilterCollector();

        $definedRouteCollector = new DefinedRouteCollector($collection);

        foreach ($definedRouteCollector->collect() as $route) {
            $sampleUri = $uriGenerator->get($route['route']);
            $filters   = $filterCollector->get($route['method']$sampleUri);

            $routeName = ($route['route'] === $route['name']) ? 'ยป' : $route['name'];

            $tbody[] = [
                strtoupper($route['method']),
                $route['route'],
                $routeName,
                
Home | Imprint | This part of the site doesn't use cookies.