src/Valkyrja/Routing/Commands/RoutesListCommand.php
public function run(): int
    {
        $routerRoutes = router()->getRoutes();
        $routes       = [];
        $headerTexts  = [
            'Request Methods',
            'Path',
            'Name',
            'Dispatch',
        ];
        $lengths      = [
            \strlen($headerTexts[0]),
            \strlen($headerTexts[1]),
            \strlen($headerTexts[2]),
            \strlen($headerTexts[3]),
        ];

        foreach ($routerRoutes as $route) {
            $this->setRoute($route, $routes, $lengths);
        }

        $sepLine = $this->getSepLine($lengths);
        $odd     = false;

        output()->writeMessage($this->oddFormat(! $odd) . $sepLine, true);
        $this->headerMessage($headerTexts, $lengths);
        output()->writeMessage($sepLine, true);

        foreach ($routes as $key => $route) {
            $routeMessage = '| '
                . $route[0]
                . str_repeat(' ', $lengths[0] - \strlen($route[0]))
                . ' | '
                . $route[1]
                . str_repeat(' ', $lengths[1] - \strlen($route[1]))
                . ' | '
                . $route[2]
                . str_repeat(' ', $lengths[2] - \strlen($route[2]))
                . ' | '
                . $route[3]
                . str_repeat(' ', $lengths[3] - \strlen($route[3]))
                . ' |';

            $odd          = $key % 2 > 0;
            $routeMessage = $this->oddFormat($odd) . $routeMessage;

            output()->writeMessage($routeMessage . static::END_FORMAT, true);
        }

        output()->writeMessage(
            $this->oddFormat(! $odd) . $sepLine . static::END_FORMAT,
            true
        );

        return 0;
    }
public function run(): int
    {
        $routerRoutes = router()->getRoutes();
        $routes       = [];
        $headerTexts  = [
            'Request Methods',
            'Path',
            'Name',
            'Dispatch',
        ];
        $lengths      = [
            \strlen($headerTexts[0]),
            \strlen($headerTexts[1]),
            \strlen($headerTexts[2]),
            \strlen($headerTexts[3]),
        ];

        foreach ($routerRoutes as $route) {
            $this->setRoute($route, $routes, $lengths);
        }

        $sepLine = $this->getSepLine($lengths);
        $odd     = false;

        output()->writeMessage($this->oddFormat(! $odd) . $sepLine, true);
        $this->headerMessage($headerTexts, $lengths);
        output()->writeMessage($sepLine, true);

        foreach ($routes as $key => $route) {
            $routeMessage = '| '
                . $route[0]
                . str_repeat(' ', $lengths[0] - \strlen($route[0]))
                . ' | '
                . $route[1]
                . str_repeat(' ', $lengths[1] - \strlen($route[1]))
                . ' | '
                . $route[2]
                . str_repeat(' ', $lengths[2] - \strlen($route[2]))
                . ' | '
                . $route[3]
                . str_repeat(' ', $lengths[3] - \strlen($route[3]))
                . ' |';

            $odd          = $key % 2 > 0;
            $routeMessage = $this->oddFormat($odd) . $routeMessage;

            output()->writeMessage($routeMessage . static::END_FORMAT, true);
        }

        output()->writeMessage(
            $this->oddFormat(! $odd) . $sepLine . static::END_FORMAT,
            true
        );

        return 0;
    }
Run the command.

@throws \InvalidArgumentException

@return int