Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Mark all dispatched event classes as final#33152

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:4.4fromTobion:final-events
Aug 21, 2019

Conversation

@Tobion
Copy link
Contributor

QA
Branch?4.4
Bug fix?no
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

I think we should mark all our Event classes as final. There is no point in people extending them as the libraries that use the event, will only dispatch this event. So extending events in user-land achieves nothing as the subclasses won't be dispatched.
I'm not talking about the base events that are meant to be extended like KernelEvent, but the leaf events like ExceptionEvent, ResponseEvent etc.
Then we can also make them real final in 5.0 as the events are value objects that should not be mocked.

fancyweb and derrabus reacted with thumbs up emoji
* @author Fabien Potencier <fabien@symfony.com>
*/
class MessageEventextends Event
finalclass MessageEventextends Event
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

@fabpot there is aMessageEvents class in the same mailer namespace. This can easily be confused with the event class and should maybe be renamed or relocated or even made internal.

Copy link
Member

Choose a reason for hiding this comment

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

isn't MessageEvents the class holding all event names as constants ? This is not internal

Copy link
ContributorAuthor

@TobionTobionAug 21, 2019
edited
Loading

Choose a reason for hiding this comment

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

The Mailer MessageEvents is a class used for logging and data collecting. It collects events but is not an event itself.

@chalasrchalasr added this to thenext milestoneAug 13, 2019
nicolas-grekas added a commit that referenced this pull requestAug 21, 2019
…so we can make it final (Tobion)This PR was merged into the 4.3 branch.Discussion----------[HttpKernel] Do not extend the new SF 4.3 ControllerEvent so we can make it final| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | no| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | unlikely| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets || License       | MIT| Doc PR        |See#33152 (comment)Remember the ControllerEvent is new in SF 4.3 so we just go back to what it was before 4.3Commits-------00140b6 Do not extend the new SF 4.3 ControllerEvent so we can make it final
@nicolas-grekas
Copy link
Member

Thank you@Tobion.

nicolas-grekas added a commit that referenced this pull requestAug 21, 2019
This PR was merged into the 4.4 branch.Discussion----------Mark all dispatched event classes as final| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | no| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets || License       | MIT| Doc PR        |I think we should mark all our Event classes as final. There is no point in people extending them as the libraries that use the event, will only dispatch this event. So extending events in user-land achieves nothing as the subclasses won't be dispatched.I'm not talking about the base events that are meant to be extended like KernelEvent, but the leaf events like ExceptionEvent, ResponseEvent etc.Then we can also make them real final in 5.0 as the events are value objects that should not be mocked.Commits-------4bb38ee Mark all dispatched event classes as final
@nicolas-grekasnicolas-grekas merged commit4bb38ee intosymfony:4.4Aug 21, 2019
@TobionTobion deleted the final-events branchAugust 21, 2019 15:51
fabpot added a commit that referenced this pull requestSep 8, 2019
This PR was merged into the 5.0-dev branch.Discussion----------Make dispatched events really final| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets || License       | MIT| Doc PR        |Continuation of#33152 for masterCommits-------953057f Make dispatched events really final
@nicolas-grekasnicolas-grekas modified the milestones:next,4.4Oct 27, 2019
This was referencedNov 12, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@stofstofstof left review comments

@OskarStarkOskarStarkOskarStark left review comments

@xabbuhxabbuhxabbuh left review comments

@chalasrchalasrchalasr left review comments

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@lyrixxlyrixxlyrixx approved these changes

@srozesrozeAwaiting requested review from sroze

+1 more reviewer

@GuilhemNGuilhemNGuilhemN left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

11 participants

@Tobion@nicolas-grekas@fabpot@javiereguiluz@lyrixx@stof@OskarStark@xabbuh@GuilhemN@chalasr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp