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

Fix mock handler on Mautic 4 #5

Open
wants to merge 1 commit into
base: mautic-3
Choose a base branch
from
Open

Fix mock handler on Mautic 4 #5

wants to merge 1 commit into from

Conversation

dennisameling
Copy link
Member

@dennisameling dennisameling commented Mar 26, 2021

NOTE: we probably need a mautic-4 branch and make that the default 😊 CC @RCheesley

bin/console mautic:integrations:sync helloworld results in the following error on Mautic 4:

$ bin/console mautic:integrations:sync helloworld

PHP Fatal error:  Declaration of MauticPlugin\HelloWorldBundle\Connection\MockedHandler::__invoke(Psr\Http\Message\RequestInterface $request, array $options) must be compatible with GuzzleHttp\Handler\MockHandler::__invoke(Psr\Http\Message\RequestInterface $request, array $options): GuzzleHttp\Promise\PromiseInterface in /var/www/html/plugins/HelloWorldBundle/Connection/MockedHandler.php on line 14

Fatal error: Declaration of MauticPlugin\HelloWorldBundle\Connection\MockedHandler::__invoke(Psr\Http\Message\RequestInterface $request, array $options) must be compatible with GuzzleHttp\Handler\MockHandler::__invoke(Psr\Http\Message\RequestInterface $request, array $options): GuzzleHttp\Promise\PromiseInterface in /var/www/html/plugins/HelloWorldBundle/Connection/MockedHandler.php on line 14

This PR fixes that!

Steps to reproduce:

  • Install Mautic from GitHub gh repo clone mautic/mautic, make sure you're on the features branch (which is Symfony 4)
  • Run cd plugins && gh repo clone mautic/plugin-helloworld HelloWorldBundle
  • Clear the cache: rm -rf ../var/cache
  • Run bin/console mautic:integrations:sync helloworld, you'll run into the error mentioned above

@cla-bot cla-bot bot added the cla-signed label Mar 26, 2021
@RCheesley
Copy link
Member

@dennisameling can you push the branch and I will then make it default and apply the branch protection rules! Guessing we should remove the 2 branch? Or keep it for posterity?!

@dennisameling
Copy link
Member Author

dennisameling commented Mar 26, 2021

@RCheesley sure thing, here it is: https://github.com/mautic/plugin-helloworld/tree/mautic-4 - let's remove the 2 branch indeed!

@RCheesley
Copy link
Member

Done!

Copy link
Member

@kuzmany kuzmany left a comment

Choose a reason for hiding this comment

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

Works for me 👍

@RCheesley
Copy link
Member

Just tried to reproduce this in Mautic 4 (features branch) PHP 7.4 and am not able to get the error you mentioned after installing the plugin at command line and then running the command - tried it a few times - have not applied this PR.

ruth.cheesley@MacBookPro-RuthCheesley plugins % ddev exec bin/console mautic:integrations:sync helloworld
[OK] Execution time: 20.785
ruth.cheesley@MacBookPro-RuthCheesley plugins % ddev exec bin/console mautic:integrations:sync helloworld
[OK] Execution time: 1.635
ruth.cheesley@MacBookPro-RuthCheesley plugins % ddev exec bin/console mautic:integrations:sync helloworld
[OK] Execution time: 1.451
ruth.cheesley@MacBookPro-RuthCheesley plugins % ddev exec bin/console mautic:integrations:sync helloworld
[OK] Execution time: 14.398

Totally possible that I missed a step someplace!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants