我有两个插件Analytify和Loginpress.在Loginpress插件中,当我将我的社交登录配置为Google(以Google登录)时,我收到以下错误:
致命错误:未捕获错误:Google\Auth\HttpHandler\HttpHandlerFactory::build():参数#1($CLIENT)的类型必须是?GuzzleHttp\ClientInterfaceAnalytify\GuzzleHttp\Client给定,在第220行的C:\USERS\wpb\Local Sites\analytify-google-login\app\public\wp-content\plugins\wp-analytify\lib\Google-GA4\vendor\google\apiclient\src\Client.php中调用 在第34行的C:\USERS\wpb\Local Sites\analytify-google-login\app\public\wp-content\plugins\loginpress-pro\addons\social-login\sdk\google-client\vendor\google\auth\src\HttpHandler\HttpHandlerFactory.php中
我已经通过改变Analytify\GuzzleHttp\Client到GuzzleHttp\Client的类已经宣布了这一点.使用php-scoper将命名空间添加到analytify插件中,scoper-inc.php代码为:
<?php
declare (strict_types=1);
namespace Analytify;
// scoper.inc.php
use Analytify\Isolated\Symfony\Component\Finder\Finder;
return [
'prefix' => 'Analytify',
// string|null
'output-dir' => null,
// string|null
'finders' => [],
// list<Finder>
'patchers' => [],
// list<callable(string $filePath, string $prefix, string $contents): string>
'exclude-files' => [],
// list<string>
'exclude-namespaces' => ['Google\\', 'Grpc\\', 'Composer\\'],
// list<string|regex>
'exclude-constants' => [],
// list<string|regex>
'exclude-classes' => [],
// list<string|regex>
'exclude-functions' => [],
// list<string|regex>
'expose-global-constants' => \true,
// bool
'expose-global-classes' => \true,
// bool
'expose-global-functions' => \true,
// bool
'expose-namespaces' => [],
// list<string|regex>
'expose-constants' => [],
// list<string|regex>
'expose-classes' => [],
// list<string|regex>
'expose-functions' => [],
];
现在我希望在这个问题上得到指导,我必须在哪个插件中解决命名空间问题,以及我如何在Analytify中解决这个问题?
当我向LoginPress添加名称空间时,它自己的功能崩溃了,这是另一个问题.此外,当我卸载Analytfiy时,我的登录开始工作得很好.但两个插件我都需要.