-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Extract request matchers for better reusability #47595
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
Conversation
I would love to simplify the |
b582774
to
1f853b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the class be renamed ChainRequestMatcher
as of Sf 7.0 and/or add a @final
?
1f853b2
to
8918499
Compare
src/Symfony/Component/HttpFoundation/RequestMatcher/AttributesRequestMatcher.php
Show resolved
Hide resolved
bcb1557
to
33f97a3
Compare
cc7b315
to
e23feac
Compare
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Outdated
Show resolved
Hide resolved
} | ||
|
||
$container | ||
->register($id, RequestMatcher::class) | ||
->register($id, ChainRequestMatcher::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->register($id, ChainRequestMatcher::class) | |
$container->register($id, ChainRequestMatcher::class) |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep the current name: it doesn't have the same interface + needless BC break ahead when renaming.
src/Symfony/Component/HttpFoundation/RequestMatcher/PathRequestMatcher.php
Show resolved
Hide resolved
src/Symfony/Component/HttpFoundation/RequestMatcher/IsJsonRequestMatcher.php
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpFoundation/RequestMatcher/AttributesRequestMatcher.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpFoundation/RequestMatcher/IpsRequestMatcher.php
Show resolved
Hide resolved
src/Symfony/Component/HttpFoundation/RequestMatcher/SchemeRequestMatcher.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/SchemeRequestMatcherTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/IpsRequestMatcherTest.php
Show resolved
Hide resolved
src/Symfony/Component/HttpFoundation/RequestMatcher/IsJsonRequestMatcher.php
Outdated
Show resolved
Hide resolved
e23feac
to
79d5ad5
Compare
0109fe9
to
961cd85
Compare
961cd85
to
c698b4b
Compare
src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
Outdated
Show resolved
Hide resolved
c698b4b
to
b081a56
Compare
src/Symfony/Component/HttpFoundation/Tests/RequestMatcher/IsJsonRequestMatcherTest.php
Show resolved
Hide resolved
b081a56
to
6cfd3b7
Compare
I had to build a factory to create an instance of |
… behaviors (GromNaN) This PR was squashed before being merged into the 7.0 branch. Discussion ---------- [HttpFoundation] Remove deprecated classes, method and behaviors | Q | A | ------------- | --- | Branch? | 7.0 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | n/a Clean `symfony/http-foundation` from all its legacy. - Remove `RequestMatcher` and `ExpressionRequestMatcher`, deprecated since #47595 - Remove `Request::getContentType()`, deprecated since #45034 - Throw a `UnexpectedValueException` or `BadRequestException` when `ParameterBag::filter()` or `InputBag::filter()` reads an invalid value and the flag `FILTER_NULL_ON_FAILURE` is not set. new behavior announced since #48525 - Throw a `InvalidArgumentException` when calling `Request::create()` with a malformed URI, deprecated since #49376 Commits ------- 665a775 [HttpFoundation] Remove deprecated classes, method and behaviors
This PR was squashed before being merged into the 7.0 branch. Discussion ---------- [Security] Update request matcher doc RequestMatcher class has been removed in 7.0 cf [code PR](symfony/symfony#47595) Changing link and rewording according to new behaviour Commits ------- f32a8cf [Security] Update request matcher doc
The
RequestMatcher
class hardcodes its matchers. This PR extracts those into their own classes so that we can compose aRequestMatcher
and allow better reusability.