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

[Security] use LegacyEventDispatcherProxy #33693

Merged
merged 1 commit into from Sep 25, 2019
Merged

Conversation

@dmaicher
Copy link
Contributor

dmaicher commented Sep 24, 2019

Q A
Branch? 4.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

I ran into an issue on one of my apps that has its own event dispatcher class using the old dispatch method signature

public function dispatch($eventName, Event $event = null)

This leads to

TypeError: Argument 2 passed to X\Tests\Base\TestEventDispatcher::dispatch() must be an instance of Symfony\Component\EventDispatcher\Event or null, string given, called in /var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php on line 230

/var/www/x/symfony/tests/Base/TestEventDispatcher.php:20
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:230
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:111

since the event here is dispatched using the new signature:

https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Security/Http/Firewall/ContextListener.php#L259

@dmaicher dmaicher force-pushed the dmaicher:dispatcher_proxy branch from 0441a01 to efac5bb Sep 24, 2019
@dmaicher dmaicher force-pushed the dmaicher:dispatcher_proxy branch from efac5bb to 7067e48 Sep 24, 2019
@xabbuh
xabbuh approved these changes Sep 25, 2019
@xabbuh xabbuh added this to the 4.3 milestone Sep 25, 2019
@xabbuh

This comment has been minimized.

Copy link
Member

xabbuh commented Sep 25, 2019

Thank you David.

xabbuh added a commit that referenced this pull request Sep 25, 2019
This PR was merged into the 4.3 branch.

Discussion
----------

[Security] use LegacyEventDispatcherProxy

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

I ran into an issue on one of my apps that has its own event dispatcher class using the old dispatch method signature

```php
public function dispatch($eventName, Event $event = null)
```

This leads to

```
TypeError: Argument 2 passed to X\Tests\Base\TestEventDispatcher::dispatch() must be an instance of Symfony\Component\EventDispatcher\Event or null, string given, called in /var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php on line 230

/var/www/x/symfony/tests/Base/TestEventDispatcher.php:20
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:230
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:111
```

since the event here is dispatched using the new signature:

https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Security/Http/Firewall/ContextListener.php#L259

Commits
-------

7067e48 [Security] use LegacyEventDispatcherProxy
@xabbuh xabbuh merged commit 7067e48 into symfony:4.3 Sep 25, 2019
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details
@dmaicher dmaicher deleted the dmaicher:dispatcher_proxy branch Sep 25, 2019
@fabpot fabpot mentioned this pull request Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.