Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Security] Deprecate callable firewall listeners#60614
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.4
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Looks good. Just one remark about the changlog.
UPGRADE-7.4.md Outdated
Security | ||
-------- | ||
* Deprecate callable firewall listeners, extend `AbstractListener` instead |
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.
extendAbstractListener
or implementFirewallListenerInterface
@@ -122,6 +123,10 @@ public static function getSubscribedEvents() | |||
protected function callListeners(RequestEvent $event, iterable $listeners) | |||
{ | |||
foreach ($listeners as $listener) { | |||
if (!$listener instanceof FirewallListenerInterface) { | |||
trigger_deprecation('symfony/security-http', '7.4', 'Using a callable as firewall listener is deprecated, extend "%s" instead.', AbstractListener::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.
This should suggest implementing the interface instead as well and hint about which class needs it if/when possible
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.
Isf2b8c5e okay?
891e58e
tof2b8c5e
Compare
Uh oh!
There was an error while loading.Please reload this page.
After spending some time in the Security component it occurred to me callable firewall listeners are obsolete now that we got the
FirewallListenerInterface
. Their deprecation has already been suggested (like in#34627 (comment) or#38751 (review)), so this PR does it.