8000 [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

Merged
nicolas-grekas merged 1 8000 commit intosymfony:6.3from
nicolas-grekas:n-opt
May 13, 2023
Merged

[Notifier] Bring consistency to bridges#50308
nicolas-grekas merged 1 commit intosymfony:6.3from
nicolas-grekas:n-opt

Conversation

@nicolas-grekas
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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