protected function getRoutes()
{
$routesData = array();
$routes = method_exists($this->app, 'getRoutes') ? $this->app->getRoutes() : [];
foreach ($routes as $route) {
$routesData[] = ['method' => $route['method'], 'uri' => $route['uri'], 'name' => array_search($route['uri'], $this->app->namedRoutes) ?: null, 'action' => isset($route['action']['uses']) && is_string($route['action']['uses']) ? $route['action']['uses'] : 'anonymous function'];
}
return $routesData;
}