diff --git a/core/lib/Drupal/Core/Http/ClientFactory.php b/core/lib/Drupal/Core/Http/ClientFactory.php index e429bbb9cda4734f9c83db529e53afee50d4b3ca..950ebb9724a544aaaed083e646de71714dd4fba5 100644 --- a/core/lib/Drupal/Core/Http/ClientFactory.php +++ b/core/lib/Drupal/Core/Http/ClientFactory.php @@ -6,6 +6,7 @@ use Drupal\Core\Site\Settings; use GuzzleHttp\Client; use GuzzleHttp\HandlerStack; +use GuzzleHttp\Utils; /** * Helper class to construct a HTTP client with Drupal specific config. @@ -49,7 +50,7 @@ public function fromOptions(array $config = []) { 'verify' => TRUE, 'timeout' => 30, 'headers' => [ - 'User-Agent' => 'Drupal/' . \Drupal::VERSION . ' (+https://www.drupal.org/) ' . \GuzzleHttp\default_user_agent(), + 'User-Agent' => 'Drupal/' . \Drupal::VERSION . ' (+https://www.drupal.org/) ' . Utils::defaultUserAgent(), ], 'handler' => $this->stack, // Security consideration: prevent Guzzle from using environment variables diff --git a/core/phpstan-baseline.neon b/core/phpstan-baseline.neon index 7857f7891789865ba1d622f33f86524cec19549a..52d14bd6a5e1954bf878765907a04c6fbc2dcd3f 100644 --- a/core/phpstan-baseline.neon +++ b/core/phpstan-baseline.neon @@ -745,14 +745,6 @@ parameters: count: 1 path: lib/Drupal/Core/Form/FormValidator.php - - - message: """ - #^Call to deprecated function GuzzleHttp\\\\default_user_agent\\(\\)\\: - default_user_agent will be removed in guzzlehttp/guzzle\\:8\\.0\\. Use Utils\\:\\:defaultUserAgent instead\\.$# - """ - count: 1 - path: lib/Drupal/Core/Http/ClientFactory.php - - message: "#^Call to deprecated constant REQUEST_TIME\\: Deprecated in drupal\\:8\\.3\\.0 and is removed from drupal\\:11\\.0\\.0\\. Use \\\\Drupal\\:\\:time\\(\\)\\-\\>getRequestTime\\(\\); $#" count: 4