Skip to content

feat(Gax)!: make ClientOptions extensible and fluid, remove modifyClientOptions - #9752

Open
bshaffer wants to merge 8 commits into
gax-v2from
gax-v2-client-options
Open

bshaffer wants to merge 8 commits into
gax-v2from
gax-v2-client-options

Conversation

@bshaffer

Copy link
Copy Markdown
Contributor
  • Make ClientOptions, CallOptions, and *TransportOptions extensible (protected properties, fluent : static setters, dynamic setter dispatch in fromArray() and offsetSet()).
  • Remove ClientOptionsTrait::modifyClientOptions() in favor of createClientOptions() and getClientOptions().

@bshaffer
bshaffer requested a review from a team as a code owner September 30, 2026 21:52
@bshaffer
bshaffer added this pull request to stack #9758 October 1, 2026 19:11
unset($arr['serviceAddress']);
}

foreach ($arr as $key => $value) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I honestly prefer the other way over this one. It makes it verbose? Yeah, but this kinda hides what we are actually setting.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was done so that we could extend client options for other service clients, e.g.

class ExperimentalFeatureClientOptions extends ClientOptions
{
    public function setMyExperimentalFeatureFlag(bool $myExperimentalFeatureFlag)
    {
    }
}

But I agree that it looks a bit messy and I prefer the explicit versions... maybe we can think of a way to have both

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants