Skip to content

[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

Merged
merged 1 commit into from
Jan 2, 2024
Merged

Conversation

OskarStark
Copy link
Contributor

Q A
Branch? 7.1
Bug fix? no
New feature? no
Deprecations? no
Issues
License MIT

@OskarStark OskarStark marked this pull request as ready for review December 27, 2023 11:53
@carsonbot carsonbot added this to the 7.1 milestone Dec 27, 2023
@OskarStark
Copy link
Contributor Author

fabbot false positive

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Rebase needed.

@OskarStark
Copy link
Contributor Author

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,
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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

Copy link
Member

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

Copy link
Member

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.

Copy link
Contributor Author

@OskarStark OskarStark Dec 29, 2023

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

Copy link
Member

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 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@OskarStark OskarStark force-pushed the cpp-notifier branch 2 times, most recently from 01acda6 to fc57f63 Compare December 30, 2023 21:28
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

rebase needed :)

@OskarStark OskarStark changed the title [Notifier] Use CPP for bridges [Notifier][Bridges] Use CPP Jan 2, 2024
@symfony symfony deleted a comment from carsonbot Jan 2, 2024
@carsonbot carsonbot changed the title [Notifier][Bridges] Use CPP [Notifier] [Bridges] Use CPP Jan 2, 2024
@nicolas-grekas
Copy link
Member

Thank you @OskarStark.

@nicolas-grekas nicolas-grekas merged commit d0887a3 into symfony:7.1 Jan 2, 2024
@keradus keradus mentioned this pull request Jan 2, 2024
@OskarStark OskarStark deleted the cpp-notifier branch January 2, 2024 16:43
nicolas-grekas added a commit that referenced this pull request Jan 3, 2024
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
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.

8 participants