10000 [Notifier] Bring consistency to bridges by nicolas-grekas · Pull Request #50308 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Notifier] Bring consistency to bridges #50308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2023

Conversation

nicolas-grekas
Copy link
Member
Q A
Branch? 6.3
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

/**
* @return $this
*/
public function diffusionName(int $diffusionName): static
Copy link
Member Author

Choose a reason for hiding this comment

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

it's a bit weird to me that an option named "diffusionName" only accepts integers
can you please confirm this is correct @gnito-org?

@nicolas-grekas
Copy link
Member Author

The TL;DR of this PR is that options shouldn't have getters when they're not required, and their setters should not start with set*.
The options should also not provide yet another way to define what the messages can already convey (from, recipient, etc.), unless there is a compelling reason to. (There might be existing option classes that violate this rule, but that shouldn't be a reason to add more.)

The rest is more CS-related.

/cc @OskarStark @alamirault since you contribute to this component. 🙏

throw new InvalidArgumentException(sprintf('The "From" number "%s" is not a valid phone number. The number must be in E.164 format.', $this->from));
$options['from'] = $message->getFrom() ?: $this->from;
$options['to'] = [$message->getPhone()];
$options['accountId'] ??= $this->accountId;
Copy link
Contributor

Choose a reason for hiding this comment

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

Before we used account_id kn the request, now accountId, is it correct or did I overlooked sth?

Copy link
Member Author

Choose a reason for hiding this comment

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

The option array should be aligned with the API. The API uses accountId, that's why.

@nicolas-grekas
Copy link
Member Author

I'm merging to fix the CI and because this is ready to me, but feel free to comment after the merge if needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0