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

Make Route, Group and MatchingResult dispatcher independent #222

Merged
merged 11 commits into from
Nov 3, 2023

Conversation

vjik
Copy link
Member

@vjik vjik commented Nov 2, 2023

Q A
Is bugfix?
New feature?
Breaks BC? ✔️
Fixed issues -

Extracted from #196

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (04be2f6) 78.66% compared to head (bf700de) 93.84%.

Additional details and impacted files
@@              Coverage Diff              @@
##             master     #222       +/-   ##
=============================================
+ Coverage     78.66%   93.84%   +15.17%     
+ Complexity      188      125       -63     
=============================================
  Files            13       11        -2     
  Lines           586      406      -180     
=============================================
- Hits            461      381       -80     
+ Misses          125       25      -100     
Files Coverage Δ
src/Group.php 100.00% <100.00%> (ø)
src/Internal/MiddlewareFilter.php 100.00% <100.00%> (ø)
src/MatchingResult.php 100.00% <ø> (ø)
src/Middleware/Router.php 100.00% <100.00%> (ø)
src/Route.php 100.00% <100.00%> (ø)
src/RouteCollection.php 100.00% <100.00%> (ø)

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

what-the-diff bot commented Nov 2, 2023

PR Summary

  • Property changes in Group and Route files
    Adjusted the .phpstorm.meta.php/Group.php and .phpstorm.meta.php/Route.php files by removing certain outdated properties like items, middlewareDefinitions, pattern and override and included new ones such as routes, hasCorsMiddleware, enabledMiddlewares, hasMiddlewares, enabledMiddlewares and methods.

  • Updates to CHANGELOG.md
    The CHANGELOG.md file has been updated with a new change entry Make Route, Group and MatchingResult dispatcher independent #222.

  • Addition of UPGRADE.md file
    Added a new file, UPGRADE.md to assist in managing future updates or migrations.

  • Revisions in src/Group.php
    These revisions mirror the same changes as in .phpstorm.meta.php/Group.php.

  • Deletion of src/MatchingResult.php
    Outdated MatchingResult.php file and its related code has been removed due to changes in code structure.

  • Reworking of src/Middleware/Router.php
    The function process() now uses the dispatch() method of the Dispatcher, making the processing of requests and responses more efficient.

  • Modifications in src/Route.php
    Old dispatcher property was removed while new properties middlewares and enabledMiddlewares were added. Renamed previous properties for better clarity and understanding moving forward - middlewareDefinitions to middlewares and disabledMiddlewareDefinitions to disabledMiddlewares.

  • Revised src/RouteCollection.php
    The code has been updated to use the newly renamed methods and properties for better code coherency.

  • Tests Updated
    Multiple tests in GroupTest.php, MatchingResultTest.php, RouteCollectionTest.php and RouteTest.php were updated. Changes entailed replacing older methods with calls to getDispatcher(), resulting in a more streamlined and elegant test structure.

@vjik vjik added the status:code review The pull request needs review. label Nov 2, 2023
@vjik vjik requested a review from a team November 2, 2023 12:32
Copy link
Member

@rustamwin rustamwin left a comment

Choose a reason for hiding this comment

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

Need to invalidate enabledMiddlewares in functions that updates middlewares property.

CHANGELOG.md Outdated Show resolved Hide resolved
UPGRADE.md Outdated Show resolved Hide resolved
src/Route.php Outdated Show resolved Hide resolved
vjik and others added 3 commits November 2, 2023 18:04
Co-authored-by: Rustam Mamadaminov <[email protected]>
Co-authored-by: Rustam Mamadaminov <[email protected]>
@vjik
Copy link
Member Author

vjik commented Nov 3, 2023

Need to invalidate enabledMiddlewares in functions that updates middlewares property.

Done.

Copy link
Member

@rustamwin rustamwin left a comment

Choose a reason for hiding this comment

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

There is a line that can be covered.

@vjik vjik merged commit 2a4f200 into master Nov 3, 2023
25 of 27 checks passed
@vjik vjik deleted the improve-matching-result branch November 3, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants