-
Notifications
You must be signed in to change notification settings - Fork 146
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
More code cleaned up, test coverage increased #38
Conversation
Added some more phpDoc and some tests to increase line coverage to 85%.
* @return \Symfony\Component\HttpFoundation\Request | ||
*/ | ||
private function getCurrentRequest() | ||
protected function getCurrentRequest() |
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 actually disagree with this: we should only add extension points when people ask and give us a good reason - that'll help maintenance in the future. If we keep this private, the can still fetch the Request if they want to, but injecting the request_stack
service into directly into some base class.
I don't agree with your comments on Take the Just my 5 cents, we can agree to disagree and I'll revert those changes. |
@curry684 In Symfony's core, we take the exact opposite stance :). But, it's definitely subjective. Here's an old blog post about that decision: http://fabien.potencier.org/pragmatism-over-theory-protected-vs-private.html. In short, private makes it much easier for us to make changes, without breaking end-user code. But if there's a use-case for protected, and we decide it's the right extension point to add, we should do that. Cheers! |
Yeah I know the post, I just tend to be on the pragmatist end of things 😉 I'll revert the protected changes tonight, code is on my laptop at home. |
Done 👍 |
Awesome, thank you! |
More generic finetuning and best practices, added some more phpDoc and some tests to increase line coverage to 85%. Made some private functionality that could limit extension protected.