Problem/Motivation
GuzzleHttp\ClientInterface::getConfig() has been deprecated and will be removed in Guzzle 8.0. These deprecations are currently being ignored and are in the PHPstan baseline:
$ignoreErrors[] = [
'message' => '#^Call to deprecated method getConfig\\(\\) of class GuzzleHttp\\\\Client\\:
ClientInterface\\:\\:getConfig will be removed in guzzlehttp/guzzle\\:8\\.0\\.$#',
'identifier' => 'method.deprecated',
'count' => 1,
'path' => __DIR__ . '/tests/Drupal/Tests/Core/Http/ClientFactoryTest.php',
];
$ignoreErrors[] = [
'message' => '#^Call to deprecated method getConfig\\(\\) of interface GuzzleHttp\\\\ClientInterface\\:
ClientInterface\\:\\:getConfig will be removed in guzzlehttp/guzzle\\:8\\.0\\.$#',
'identifier' => 'method.deprecated',
'count' => 1,
'path' => __DIR__ . '/tests/Drupal/Tests/DrupalTestBrowser.php',
];
$ignoreErrors[] = [
'message' => '#^Call to deprecated method getConfig\\(\\) of class GuzzleHttp\\\\Client\\:
ClientInterface\\:\\:getConfig will be removed in guzzlehttp/guzzle\\:8\\.0\\.$#',
'identifier' => 'method.deprecated',
'count' => 1,
'path' => __DIR__ . '/tests/Drupal/Tests/BrowserTestBase.php',
];
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3605380
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
godotislateThis is turning out to be pretty tricky. I thought the easiest one to fix would be to directly access to the client handler stack, instead of using
getConfig(), since stack is registered service. Unfortunately, it's declared private, and I haven't been able yet to make it public just within browser tests. Ideally, instead of accessing the stack directly, it'd probably be better to register middleware using thehttp_client_middlewareservice tag, but that's complicated as well, since the logger depends on properties in the browser test class.Comment #4
longwaveGiven #3612544: Update to Guzzle 8 is green I don't think we actually need to do this. Guzzle 8 removes the method from the interface, but keeps the method on the concrete class, so we didn't need to make any changes. Suggest closing won't fix and we just leave this alone in Drupal 11.
Comment #5
godotislateYeah, found this: https://github.com/guzzle/guzzle/issues/3114#issuecomment-1627228395
Closing. Maybe PHPStan will be unhappy sometime in the future, but we can deal with that then by ignoring if needed.