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

Match route #9

Merged
merged 4 commits into from
Apr 16, 2023
Merged

Match route #9

merged 4 commits into from
Apr 16, 2023

Conversation

antonio-gg-dev
Copy link
Member

📚 Description

Add the match() method to the Router that allows subscribing a route to multiple HTTP methods simultaneously.

🔖 Changes

  • I classified the tests into several groups, there are already many tests but I have been able to see that they could be classified into four groups according to the functionality being tested, and so I have done it, I hope you like it!
  • Added the match method described in the description.
  • Routes class have been greatly refactored, now there is much less code and methods are reused much more, I think now it is easier to understand how it works.

Copy link
Member

@Chemaclass Chemaclass left a comment

Choose a reason for hiding this comment

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

Awesome work 💡👏

@Chemaclass Chemaclass merged commit ee99b46 into main Apr 16, 2023
@Chemaclass Chemaclass deleted the match-route branch April 16, 2023 22:32
$_SERVER['REQUEST_URI'] = 'https://example.org/expected/uri';
$_SERVER['REQUEST_METHOD'] = $testMethod;

$this->expectOutputString('');
Copy link
Member

Choose a reason for hiding this comment

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

Should we throw an exception with a 404 error code? @Tito-Kati @Chemaclass

Copy link
Member

Choose a reason for hiding this comment

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

Yeah! We currently don't have support for 404, so this is a nice follow up feature to implement ;)

$_SERVER['REQUEST_URI'] = 'https://example.org/expected/uri';
$_SERVER['REQUEST_METHOD'] = 'GET';

$this->expectOutputString('');
Copy link
Member

Choose a reason for hiding this comment

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

Same here?

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

Successfully merging this pull request may close these issues.

3 participants