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 routes options to be recognizable via used HTTP request method #3751

Merged
merged 4 commits into from
Oct 11, 2020

Conversation

michalsn
Copy link
Member

@michalsn michalsn commented Oct 10, 2020

Description
This PR fixes routes options to be recognizable via used HTTP request method. Right now routes options are shared - one instance per route. It leads to problems like: wrong named route name returned or firing incorrect filter.

I don't think this will introduce any BC, rather will fix buggy behavior, but if anyone notices the problem please let me know.

Fixes #3700
Fixes #3733

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • N/A User guide updated
  • Conforms to style guide

Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

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

I like this. I agree with @samsonasik's changes, also... I know getRoutes() has an unspecified variable type on $verb but other things will break if it is not string|null so I think we should go ahead and update the function declaration to be consistent.

Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
Co-authored-by: John Paul E. Balandan, CPA <51850998+paulbalandan@users.noreply.github.com>
@michalsn
Copy link
Member Author

Thanks for your code suggestions guys.

@michalsn michalsn requested a review from MGatner October 10, 2020 17:13
@MGatner MGatner merged commit 0616d62 into codeigniter4:develop Oct 11, 2020
@element-code
Copy link
Contributor

👍 i was writing a bug report just at this moment and saw the merge while digging for the buggy code 🎆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants