Decompose Utils into focused APIs and internal services
Author: GrahamCampbellCreated Jul 16, 2026Updated Aug 5, 2026
Labelskind/enhancementkind/tech-debt
Guzzle 8 has already removed several unrelated Utils methods and moved no-proxy handling to ProxyOptions. We will finish separating the remaining responsibilities after 8.0.
- Replace
Utils::chooseHandler()withHandlerFactory::createDefault(). - Replace
Utils::headersFromLines()andUtils::normalizeHeaderKeys()withHeaders::fromLines()andHeaders::normalizeKeys(). - Replace
Utils::debugResource()withDebugResource::from(). - Replace
Utils::normalizeProtocols()withProtocols::normalize(). - Move
Utils::defaultUserAgent()toClient::defaultUserAgent().
The public replacements will land in 8.1. The old public methods will become exact PHPDoc-deprecated delegates, without runtime warnings, and will be removed in 9.0. Handler selection, exceptions, and diagnostics behavior will remain unchanged.
Source: guzzle/guzzle