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

Command icon 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

godotislate created an issue.

godotislate’s picture

This 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 the http_client_middleware service tag, but that's complicated as well, since the logger depends on properties in the browser test class.