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. See original summary.

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.

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

Given #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.

godotislate’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Yeah, found this: https://github.com/guzzle/guzzle/issues/3114#issuecomment-1627228395

This is marked as deprecated, but probably I won't actually ever remove this. I just want to encourage people to not use it.

Closing. Maybe PHPStan will be unhappy sometime in the future, but we can deal with that then by ignoring if needed.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.