Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Conversation

@chr-hertel
Copy link
Member

No description provided.

@chr-hertel chr-hertel force-pushed the fix-http-client-factory branch from 44abd56 to 7d8613f Compare December 8, 2024 00:51
@chr-hertel chr-hertel merged commit 8b88d5d into main Dec 8, 2024
7 checks passed
@chr-hertel chr-hertel deleted the fix-http-client-factory branch December 8, 2024 01:30
public static function create(#[\SensitiveParameter] string $apiKey, string $version = '2023-06-01'): Platform
{
$responseHandler = new ModelHandler(new EventSourceHttpClient(), $apiKey, $version);
public static function create(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using a withHttpClient() method?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a separate method? What's the benefit?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can instantiate it and change it later, maybe because you want to inject a traceable http client later + you could return a clone to stay immutable, but just an idea and maybe not needed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that was basically the motivation here - to use the factory in the bundle but use the traceable one instantiated by the framework already

@chr-hertel chr-hertel added the bug Something isn't working label Mar 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants