Skip to content

[HttpKernel] PostResponseEvent should extend the KernelEvent #16430

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
Nov 4, 2015

Conversation

jakzal
Copy link
Contributor

@jakzal jakzal commented Nov 2, 2015

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #16342
License MIT
Doc PR -

Technically the PostResponseEvent is a KernelEvent.

@Tobion
Copy link
Contributor

Tobion commented Nov 2, 2015

Why is it a KernelEvent? It's not triggered from the Kernel.

@jakzal
Copy link
Contributor Author

jakzal commented Nov 2, 2015

Well, it is dispatched from the HttpKernel::terminate() method.

@Tobion
Copy link
Contributor

Tobion commented Nov 2, 2015

True. But as discussed in #16342, the terminate event is always for master requests only. So exposing a getRequestType might just create more confusion. But for consistency I can see the value in this approach.

@xabbuh
Copy link
Member

xabbuh commented Nov 3, 2015

What do you think about overriding getRequestType() in PostResponsEvent, always return HttpKernelInterface::MASTER_REQUEST there and add a comment explaining the reasons? This way we will hopefully avoid confusion for people wondering why there is a getRequestType() method for this event.

@jakzal
Copy link
Contributor Author

jakzal commented Nov 3, 2015

@xabbuh the request type is set in the constructor. I don't think there's need to override getRequestType().

I don't see how this could be confusing really.

@Tobion
Copy link
Contributor

Tobion commented Nov 3, 2015

Î suggest to add a phpdoc at the class level explaining that it always returns MASTER_REQUEST

@jakzal jakzal force-pushed the post-response-kernel-event branch from fffc3ff to b9863d5 Compare November 3, 2015 16:51
@jakzal
Copy link
Contributor Author

jakzal commented Nov 3, 2015

@Tobion done

@Tobion
Copy link
Contributor

Tobion commented Nov 3, 2015

👍

Status: reviewed

@xabbuh
Copy link
Member

xabbuh commented Nov 3, 2015

👍 (the comment in the class docblock really is enough)

@fabpot
Copy link
Member

fabpot commented Nov 4, 2015

Thank you @jakzal.

@fabpot fabpot merged commit b9863d5 into symfony:2.8 Nov 4, 2015
fabpot added a commit that referenced this pull request Nov 4, 2015
…lEvent (jakzal)

This PR was merged into the 2.8 branch.

Discussion
----------

[HttpKernel] PostResponseEvent should extend the KernelEvent

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16342
| License       | MIT
| Doc PR        | -

Technically the `PostResponseEvent` is a `KernelEvent`.

Commits
-------

b9863d5 [HttpKernel] PostResponseEvent should extend the KernelEvent
@jakzal jakzal deleted the post-response-kernel-event branch November 4, 2015 07:47
@fabpot fabpot mentioned this pull request Nov 16, 2015
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.

5 participants