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

Refactoring + Tests + MSI 100% #22

Merged
merged 12 commits into from
Dec 6, 2024
Merged

Refactoring + Tests + MSI 100% #22

merged 12 commits into from
Dec 6, 2024

Conversation

vjik
Copy link
Member

@vjik vjik commented Nov 24, 2024

Q A
Is bugfix? ✔️
New feature?
Breaks BC?

Copy link

codecov bot commented Nov 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@58f5565). Learn more about missing BASE report.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##             master       #22   +/-   ##
==========================================
  Coverage          ?   100.00%           
  Complexity        ?        22           
==========================================
  Files             ?         1           
  Lines             ?        91           
  Branches          ?         0           
==========================================
  Hits              ?        91           
  Misses            ?         0           
  Partials          ?         0           

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

@vjik vjik requested a review from a team November 24, 2024 11:49
@vjik vjik added the status:code review The pull request needs review. label Nov 24, 2024
return;
}

$directoryPath = $matches[1];
$controllerName = $matches[2];
[$_, $directoryPath, $controllerName] = $matches;
Copy link
Member

Choose a reason for hiding this comment

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

I'd leave it as it was before

Copy link
Member Author

Choose a reason for hiding this comment

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

Replaced to [, $directoryPath, $controllerName] = $matches;

$path,
);

if (!preg_match('#^(.*?)/([^/]+)/?$#', $controllerName, $matches)) {
if (!preg_match('#^/?(.*?)/([^/]+)/?$#', $controllerName, $matches)) {
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Member

Choose a reason for hiding this comment

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

That enables / prefixing controller name. Use-case for that is interesting.

Copy link
Member Author

@vjik vjik Nov 25, 2024

Choose a reason for hiding this comment

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

Here $controllerName contains path with uppercased first symbols. Renamed it to $pathAsNamespace.

This regexp should be valid for paths with one and more items (/user, /user/profile, /user/profile/view).

{
return str_replace(
Copy link
Member

Choose a reason for hiding this comment

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

As far as I remember there were some Windows cases where such operations are necessary to make the router work correctly

Copy link
Member Author

Choose a reason for hiding this comment

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

src/FileRouter.php Outdated Show resolved Hide resolved
@vjik vjik requested a review from xepozz November 25, 2024 11:36
@samdark samdark merged commit 9ce3b0f into master Dec 6, 2024
18 checks passed
@samdark samdark deleted the refactor branch December 6, 2024 06:37
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