Skip to content

Commit

Permalink
Merge pull request #16366 from craftcms/feature/di-guzzle-client
Browse files Browse the repository at this point in the history
Support DI for Guzzle client
  • Loading branch information
brandonkelly authored Jan 2, 2025
2 parents e652c1e + 54a2bc6 commit 9791899
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG-WIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Deprecated the `ucfirst` Twig filter. `capitalize` should be used instead.

## Extensibility
- `GuzzleHttp\Client` is now instantiated via `Craft::createObject()`. ([#16366](https://github.com/craftcms/cms/pull/16366))
- `craft\helpers\DateTimeHelper::humanDuration()` now has a `$language` argument. ([#16332](https://github.com/craftcms/cms/pull/16332))

## System
Expand Down
2 changes: 1 addition & 1 deletion src/Craft.php
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public static function createGuzzleClient(array $config = []): Client
$guzzleConfig['proxy'] = $generalConfig->httpProxy;
}

return new Client($guzzleConfig);
return Craft::createObject(Client::class, [$guzzleConfig]);
}
}

Expand Down

0 comments on commit 9791899

Please sign in to comment.