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

Can not create a Webhook #6

Open
NgesBrian opened this issue Mar 27, 2019 · 4 comments
Open

Can not create a Webhook #6

NgesBrian opened this issue Mar 27, 2019 · 4 comments
Assignees

Comments

@NgesBrian
Copy link

Great job in this project as I will like to use this in my yii2 api to push data eg notifications from the API to any frontend that will make my app real time using webhook. My frontend is in reactjs. I have successfully installed and migrated the package. I have tried to run index.php/webhooks?r=/webhooks/create and I am getting
TypeError
Return value of degordian\webhooks\Module::validateWebhookClass() must be an instance of degordian\webhooks\void, none returned.

Al line 62 of /vendor/degordian/yii2-webhooks/src/Module.php.

I am using Yii2 Advance and I have created it as an API.

Here is part of my config/main.php

'bootstrap' => ['log', 'webhooks'],
'modules' => [
'v1' => [
'basePath' => '@app/modules/v1',
'class' => 'api\modules\v1\Module',
],
'webhooks' => [
'class' => 'degordian\webhooks\Module',
'eventDispatcherComponentClass' => 'app\components\MyDispatcher',
],
],

Please is the error coming from my end and How do I fix this ??

@napravicukod
Copy link
Contributor

You need to update your php version, dependency is php >= 7.1
If it is out of your control, you can fork the repo and remove all the php >= 7.1 specifics in the code

@NgesBrian
Copy link
Author

I have updated my php version to 7.1.27 but I still get this error. I have forked the project and I cant see any php>=7.1 anywhere. Can help with an example file ??
Please what can I do to solve the issue

@napravicukod napravicukod self-assigned this Apr 1, 2019
@napravicukod
Copy link
Contributor

napravicukod commented Apr 1, 2019

There is a dependency inside the composer.json file.
Please uninstall the package

composer remove degordian/yii2-webhooks

and then install the package from dev-master:

composer require --prefer-dist degordian/yii2-webhooks "dev-master"

I have tried with php 7.1.25 and a clean yii2-advanced template and everything seems fine.

If you dont have your own EventDispatcher class, remove the

'eventDispatcherComponentClass' => 'app\components\MyDispatcher',

from config

If this doesn't help, let me know.

@napravicukod napravicukod reopened this Apr 1, 2019
@NgesBrian
Copy link
Author

there is a bug trying to install this package using the above command.
Potential causes:

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

No branches or pull requests

2 participants