Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add route/list command #96

Merged
merged 34 commits into from May 18, 2020
Merged

Add route/list command #96

merged 34 commits into from May 18, 2020

Conversation

rustamwin
Copy link
Member

Q A
Is bugfix?
New feature?
Breaks BC?
Tests pass? -
Fixed issues -

rustamwin and others added 28 commits November 15, 2019 17:13
@rustamwin rustamwin requested review from samdark and a team May 7, 2020 07:31
@rustamwin rustamwin added the type:enhancement Enhancement label May 7, 2020
@samdark samdark added the status:code review The pull request needs review. label May 7, 2020
Copy link

@schmunk42 schmunk42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is great.

It would be nice if we could, in general, switch between (console)-table output and eg. json, but that can be done later.

$table = new Table($output);
$io = new SymfonyStyle($input, $output);
/** @var Route[] $routes */
$routes = $this->urlMatcher->getRouteCollection()->getRoutes();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it will be better to use RouteCollection()->getRouteTree(false) to get routes tree

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yiiliveext or we need to drop getRouteTree method from RouteCollection instead?

Copy link
Contributor

@yiiliveext yiiliveext May 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yiiliveext or we need to drop getRouteTree method from RouteCollection instead?

Routes tree is more informative and convenient. It is used by the debugger.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it will be better to use RouteCollection()->getRouteTree(false) to get routes tree

This is a route table, not a tree.

$table = new Table($output);
$io = new SymfonyStyle($input, $output);
/** @var Route[] $routes */
$routes = $this->urlMatcher->getRouteCollection()->getRoutes();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yiiliveext or we need to drop getRouteTree method from RouteCollection instead?

src/Command/Route/ListCommand.php Outdated Show resolved Hide resolved
src/Command/Route/ListCommand.php Outdated Show resolved Hide resolved
src/Command/Route/ListCommand.php Outdated Show resolved Hide resolved
src/Command/Route/ListCommand.php Outdated Show resolved Hide resolved
src/Command/Route/ListCommand.php Outdated Show resolved Hide resolved
@samdark samdark added status:under development Someone is working on a pull request. and removed status:code review The pull request needs review. labels May 10, 2020
@rustamwin rustamwin added status:code review The pull request needs review. status:under development Someone is working on a pull request. and removed status:under development Someone is working on a pull request. status:code review The pull request needs review. labels May 12, 2020
@rustamwin rustamwin added status:code review The pull request needs review. and removed status:under development Someone is working on a pull request. labels May 14, 2020
@samdark samdark merged commit 4b716c1 into yiisoft:master May 18, 2020
@samdark
Copy link
Member

samdark commented May 18, 2020

Good one. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants