We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
System Name: alpine3.9 PHP Version: 7.3.13 Swoole Version: 4.5.2 Skeleton Version: 2.2.12
$client = context()->get('guzzle');
handler must be a callable
<?php return [ // Guzzle [ // 名称 'name' => 'guzzle', // 类路径 'class' => \GuzzleHttp\Client::class, // 构造函数注入 'constructorArgs' => [ // config [ 'handler' => new \Mix\Guzzle\Handler\StreamHandler, ], ], ], ];
The text was updated successfully, but these errors were encountered:
@liushzhql https://github.com/mix-php/guzzle 的新版本其实已经不需要指定 handler 了, 安装即hook,这里确实有问题,因为设计依赖注入的时候构造参数本身是支持 ref 引用,但是这里是 $config 里面了,是不支持引用的,所以抛出异常,这里我忽略了,新的骨架将移除 handler 的配置,因为其实已经不需要了
// Guzzle [ // 名称 'name' => 'guzzle', // 类路径 'class' => \GuzzleHttp\Client::class, // 构造函数注入 'constructorArgs' => [ // config [ 'handler' => ['ref' => Mix\Guzzle\Handler\StreamHandler::class], // 这里不支持,因为是在业务参数 $config 中 ], // foo ['ref' => Foo::class] // 这种在一级参数就支持 ], ],
Sorry, something went wrong.
No branches or pull requests
修改bean文件,将ref依赖注入改为直接传入handler实例
/mix/manifest/beans/guzzle.php
The text was updated successfully, but these errors were encountered: