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

#336 Proper Detection of EventDispatcherInterface [1.5] #365

Merged
merged 1 commit into from Dec 19, 2022

Conversation

zebraf1
Copy link

@zebraf1 zebraf1 commented Apr 8, 2022

Follow-up for #358 (not needed for master)

Fix issue #336

Context

dispatch() was called with wrong order of parameters when using Codeception 4.1.15 or higher which added a class alias for EventDispatcher\Event.

What has been done

  • Using recommendation by @Naktibalda to detect which version of dispatch method must be used.

How to test

  • install codeception/codeception ^4.1.14
  • install php-vcr ^1.5
  • install symfony/event-dispatcher ^5.0
  • Call Videorecorder->handleRequest() with proper cassette inserted
  • Must not produce error: [TypeError] Argument 1 passed to Symfony\Component\EventDispatcher\EventDispatcher::dispatch() must be an object, string given, called in .../vendor/php-vcr/php-vcr/src/VCR/Videorecorder.php on line 99

Fix issue where dispatch() was called with wrong order of parameters when using Codeception 4.1.15 or higher which added a class alias for EventDispatcher\Event.
Using recommendation by @Naktibalda to detect which version of dispatch method must be used
@zebraf1
Copy link
Author

zebraf1 commented Apr 8, 2022

I created a new PR from 1.5 and cherry-picked the commit from previous PR

@zebraf1 zebraf1 changed the title #336 Proper Detection of EventDispatcherInterface #336 Proper Detection of EventDispatcherInterface [1.5] Apr 8, 2022
@specialtactics
Copy link
Contributor

Hi, Would invite you to make this PR on our fork, if not we will likely do so ourselves at some point:
https://github.com/CoverGenius/php-vcr

@higidi higidi added the Bug Something isn't working label Dec 19, 2022
@higidi higidi merged commit e261cbc into php-vcr:1.5 Dec 19, 2022
@higidi
Copy link
Contributor

higidi commented Dec 19, 2022

Thx 4 contributing ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants