Merge pull request #9 from cacahouwete/fix-deprecated-use

Fix deprecated use of ReflectionParameter::getClass for php 8
This commit is contained in:
Yozhef
2021-12-13 10:48:21 +02:00
committed by GitHub

View File

@@ -116,7 +116,8 @@ class GoutteFactory implements DriverFactory
{
$refl = new \ReflectionParameter(array('Goutte\Client', 'setClient'), 0);
if ($refl->getClass() && 'Guzzle\Http\ClientInterface' === $refl->getClass()->getName()) {
$type = $refl->getType();
if ($type instanceof \ReflectionNamedType && 'Guzzle\Http\ClientInterface' === $type->getName()) {
return true;
}