maknz / slack

A simple PHP package for sending messages to Slack, with a focus on ease of use and elegant syntax.
BSD 2-Clause "Simplified" License
1.17k stars 204 forks source link

Can't use with this SDK #19

Closed KingYes closed 9 years ago

KingYes commented 9 years ago

Hi.. I get this error:

 Catchable fatal error: Argument 1 passed to React\Promise\Promise::__construct() must be callable, null given, called in /home/yakir/slack-app/vendor/react/promise/src/Deferred.php on line 25 and defined in /home/yakir/slack-app/vendor/react/promise/src/Promise.php on line 16

That's the code:

use \Maknz\Slack\Client;

include( __DIR__ . '/vendor/autoload.php' );
$settings = [];
$client = new Client( 'my.endpoint', $settings );
$client->send( 'Test msg' );
maknz commented 9 years ago

Looks like something to do with React, no? If you can trace it back to a code problem in this library I'll take a look.

On Sun, May 31, 2015 at 7:29 AM, Yakir Sitbon notifications@github.com wrote:

Hi.. I get this error:

 Catchable fatal error: Argument 1 passed to React\Promise\Promise::__construct() must be callable, null given, called in /home/yakir/slack-app/vendor/react/promise/src/Deferred.php on line 25 and defined in /home/yakir/slack-app/vendor/react/promise/src/Promise.php on line 16

That's the code:

use \Maknz\Slack\Client;
include( __DIR__ . '/vendor/autoload.php' );
$settings = [];
$client = new Client( 'my.endpoint', $settings );
$client->send( 'Test msg' );

Reply to this email directly or view it on GitHub: https://github.com/maknz/slack/issues/19

KingYes commented 9 years ago

Nope. I don't change anything.. just download from compress. How I can trace it back for you?

maknz commented 9 years ago

The stack trace you provided only mentions React, I haven't really got any reason to think there's a problem with this package.

On Sun, May 31, 2015 at 10:11 AM, Yakir Sitbon notifications@github.com wrote:

Nope. I don't change anything.. just download from compress.

How I can trace it back for you?

Reply to this email directly or view it on GitHub: https://github.com/maknz/slack/issues/19#issuecomment-107094393

KingYes commented 9 years ago

How I can give you this log?

maknz commented 9 years ago

Probably around where you got your original stack trace? Further down? Above? Does it mention an error in this package somewhere?

On Sun, May 31, 2015 at 10:16 AM, Yakir Sitbon notifications@github.com wrote:

How I can give you this log?

Reply to this email directly or view it on GitHub: https://github.com/maknz/slack/issues/19#issuecomment-107094604

KingYes commented 9 years ago

Nope. Just if I use send() method I get this error

KingYes commented 9 years ago

Maybe that error cuz I run your code from WordPress?

KingYes commented 9 years ago

I get log from the error, please give me your email to send you this file..

maknz commented 9 years ago

Paste it here man.

KingYes commented 9 years ago

https://gist.github.com/KingYes/979c7889795b191e7807

maknz commented 9 years ago

Thanks for that. Looks like a problem with Guzzle or the data we're passing to Guzzle. I'll look into it and maybe get hold of the Guzzle people to see if they have any ideas. It looks like you're doing everything correctly, though.

KingYes commented 9 years ago

Okay, Thanks.

maknz commented 9 years ago

Can you try specifying an older version of Guzzle to see if 5.3.0 is the problem? Try specifying "guzzlehttp/guzzle": "5.0.0" in your project's composer.json file. If that fails, try using 4.0.0.

If that works, we can fairly certainly say Guzzle is the problem, otherwise there could be an issue in how we're calling it.

maknz commented 9 years ago

Also, I notice you made that Gist secret, but do you mind if I provide it to the Guzzle maintainers?

KingYes commented 9 years ago

Okay, I try with 5.0.0 version and same error. But with 4.0.0 it's seem work's perfect. And you can send this to Guzzle maintainers.

maknz commented 9 years ago

Excellent. Change your 4.0.0 constraint to ~4.0 so you get at least the latest version of 4.x.

I've opened an issue with Guzzle, hopefully they can shed some light. I'm fairly certain there must be a problem with your environment as nobody else has had any issue with Guzzle 5, but they might have seen it before.

maknz commented 9 years ago

Closing this because the problem is isolated to your environment and isn't affecting other users, and the issue relates to Guzzle rather than this package.