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

fix: [Auto Routing Improved] spark routes shows invalid routes #7419

Merged
merged 3 commits into from
Apr 11, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Apr 10, 2023

Description
Supersedes #7417
Fixes #7415

Methods that are not routed should be removed.
So the command shows them with x so that developers know.

Before:

+-----------+--------------+------+-------------------------------------+----------------+---------------+
| Method    | Route        | Name | Handler                             | Before Filters | After Filters |
+-----------+--------------+------+-------------------------------------+----------------+---------------+
| GET(auto) | dir          |      | \App\Controllers\Dir\Home::getIndex |                | toolbar       |
| GET(auto) | dir/home/foo |      | \App\Controllers\Dir\Home::getFoo   | <unknown>      | <unknown>     |
| GET(auto) | /            |      | \App\Controllers\Home::getIndex     |                | toolbar       |
| GET(auto) | home/foo     |      | \App\Controllers\Home::getFoo       | <unknown>      | <unknown>     |
+-----------+--------------+------+-------------------------------------+----------------+---------------+

After:

+-----------+----------------+------+-------------------------------------+----------------+---------------+
| Method    | Route          | Name | Handler                             | Before Filters | After Filters |
+-----------+----------------+------+-------------------------------------+----------------+---------------+
| GET(auto) | dir            |      | \App\Controllers\Dir\Home::getIndex |                | toolbar       |
| GET(auto) | x dir/home/foo |      | \App\Controllers\Dir\Home::getFoo   | <unknown>      | <unknown>     |
| GET(auto) | /              |      | \App\Controllers\Home::getIndex     |                | toolbar       |
| GET(auto) | x home/foo     |      | \App\Controllers\Home::getFoo       | <unknown>      | <unknown>     |
+-----------+----------------+------+-------------------------------------+----------------+---------------+

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Apr 10, 2023
Shows invalid routes with `x` to let devs know there are methods.
@kenjis kenjis force-pushed the fix-spark-routes-auto-routing branch from 1df8a1b to 4134a84 Compare April 10, 2023 23:54
@datamweb
Copy link
Contributor

@kenjis Good job, but I have a question.
How is the end user supposed to know what you mean by X?

@kenjis
Copy link
Member Author

kenjis commented Apr 11, 2023

@datamweb Is it hard to understand when you see it for the first time?

@datamweb
Copy link
Contributor

@datamweb Is it hard to understand when you see it for the first time?

For me really yes, I understood after your explanation in the comment.
I didn't see any explanation about this in the documentation you added.
Or maybe add a small note in the output or add a separate column.

@kenjis
Copy link
Member Author

kenjis commented Apr 11, 2023

@datamweb I added the documentation.

Copy link
Contributor

@datamweb datamweb left a comment

Choose a reason for hiding this comment

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

@kenjis thank you!

@kenjis kenjis merged commit 3733dab into codeigniter4:develop Apr 11, 2023
@kenjis kenjis deleted the fix-spark-routes-auto-routing branch April 11, 2023 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: spark routes shows invalid routes with Auto Routing Improved
3 participants