-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Notifier] [Bridges] Use CPP #53230
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
[Notifier] [Bridges] Use CPP #53230
Conversation
OskarStark
commented
Dec 27, 2023
Q | A |
---|---|
Branch? | 7.1 |
Bug fix? | no |
New feature? | no |
Deprecations? | no |
Issues | |
License | MIT |
src/Symfony/Component/Notifier/Bridge/RocketChat/RocketChatTransport.php
Outdated
Show resolved
Hide resolved
fabbot false positive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase needed.
4f6e4af
to
9c1d85b
Compare
Rebase done ✅ |
@@ -31,7 +31,8 @@ final class BandwidthTransport extends AbstractTransport | |||
|
|||
public function __construct( | |||
private readonly string $username, | |||
#[\SensitiveParameter] private readonly string $password, | |||
#[\SensitiveParameter] | |||
private readonly string $password, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any opinion on this change @symfony/mergers?
which one is the most readable to you?
on my side, I don't mind long lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im happy with the two lines. I think it is more readable. Especially if you have very long attributes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the one line more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for long one-liners. 2 lines break my brain when reading the property list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh.. I dont want to be responsible for breaking Robin's brain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So shall I revert all bridges to one line?
In all docs (cc @javiereguiluz), and especially if we use attributes with parameters, we tend to use two lines for readability, because
#[MapRequestPaylod(foo: bar, baz: baz)] private readonly Class $foo
is quite noisy.
Please advice and I will take the wanted direction across all bridges
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really depends on the length of the attribute part.
When a line-split feels needed, I think we should require adding blank lines before and after the corresponding argument declaration.
In this case, the oneliner is better to me, so yes, please update all lines found in this PR and other similar PRs, if any 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the docs, we follow Symfony coding standards except from the line length. This is in part also because code blocks in the documentation are at most 726px wide, we don't want to overwhelm readers with too much characters and code examples are often very short.
In Symfony code, we often favor longer lines. This is in part because editors are often fullscreen on a wide screen and having more "real" lines vertically allows you to see code more in context (at least, that's how I experience it). This is also why we e.g. always one-line exceptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
01acda6
to
fc57f63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebase needed :)
src/Symfony/Component/Notifier/Bridge/AllMySms/AllMySmsTransport.php
Outdated
Show resolved
Hide resolved
fc57f63
to
302ab8a
Compare
2d6c3b0
to
a7deb7a
Compare
Thank you @OskarStark. |
This PR was squashed before being merged into the 7.1 branch. Discussion ---------- CS: trailing commas | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Issues | CS <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT kind-of requested in #53230 (comment) cc `@OskarStark` The diff may be bigger and tricky. I put each part of standalone change as separated commit, easy to revert if you don't like particular change. This PR is more demonstration what we can do with Fixer, you decides which way to go Commits ------- 0cda041 CS: trailing commas