使用 'GrahamCampbell/Laravel-GitHub' 时如何修复“函数 Http\Adapter\Guzzle6\Client::buildClient() 的参数太少”
how to fix'Too few arguments to function Http\Adapter\Guzzle6\Client::buildClient()' when use 'GrahamCampbell/Laravel-GitHub'
我用 laravel 制作了一个用于管理教育机构的 Web 应用程序,所以我必须制作一个协作工作区。
我发现的想法是使用 GitHub 存储库,在网上搜索后我发现 'GrahamCampbell / Laravel-GitHub'。
我像文档一样安装,但是当我测试时出现以下错误:
Too few arguments to function Http \ Adapter \ Guzzle6 \ Client :: buildClient (),
0 passed in C: \ Users \ Fehmi \ Dropbox \ GRASP \ vendor \ php-http \ guzzle6-adapter \ src \ Client.php on line 31 and exactly 1 expected "
use GrahamCampbell\GitHub\Facades\GitHub;
class GitController extends Controller
{
public function FuncName ()
{
dd(GitHub::me()->organizations());
}
}
我得到的结果是
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_RECOVERABLE_ERROR)
Too few arguments to function Http\Adapter\Guzzle6\Client::buildClient(), 0 passed in C:\Users\Fehmi\Dropbox\GRASP\vendor\php-http\guzzle6-adapter\src\Client.php on line 31 and exactly 1 expected
确保使用最新的 php-http/guzzle6-adapter
版本。
只有 one from May 2016 has a line 31 with $client = static::buildClient();
, and it had an issue fixed in PR 32 to allow calling the buildClient()
with no parameters.
GrahamCampbell/Laravel-GitHub
only imposes a guzzle6 version as a range between 1.0 (included) and 2.0.
也许使用 ^2.0
或至少 ^1.1
可能会有帮助。
我用 laravel 制作了一个用于管理教育机构的 Web 应用程序,所以我必须制作一个协作工作区。
我发现的想法是使用 GitHub 存储库,在网上搜索后我发现 'GrahamCampbell / Laravel-GitHub'。
我像文档一样安装,但是当我测试时出现以下错误:
Too few arguments to function Http \ Adapter \ Guzzle6 \ Client :: buildClient (),
0 passed in C: \ Users \ Fehmi \ Dropbox \ GRASP \ vendor \ php-http \ guzzle6-adapter \ src \ Client.php on line 31 and exactly 1 expected "
use GrahamCampbell\GitHub\Facades\GitHub;
class GitController extends Controller
{
public function FuncName ()
{
dd(GitHub::me()->organizations());
}
}
我得到的结果是
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_RECOVERABLE_ERROR)
Too few arguments to function Http\Adapter\Guzzle6\Client::buildClient(), 0 passed in C:\Users\Fehmi\Dropbox\GRASP\vendor\php-http\guzzle6-adapter\src\Client.php on line 31 and exactly 1 expected
确保使用最新的 php-http/guzzle6-adapter
版本。
只有 one from May 2016 has a line 31 with $client = static::buildClient();
, and it had an issue fixed in PR 32 to allow calling the buildClient()
with no parameters.
GrahamCampbell/Laravel-GitHub
only imposes a guzzle6 version as a range between 1.0 (included) and 2.0.
也许使用 ^2.0
或至少 ^1.1
可能会有帮助。