-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Misc changes #4695
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
Misc changes #4695
Conversation
ifdattic
commented
Dec 28, 2014
Q | A |
---|---|
Doc fix? | yes |
New docs? | no |
Applies to | 2.3 |
Fixed tickets |
👍 |
@@ -174,7 +175,8 @@ manually. In our application, we have this situation in ``CommentController``: | |||
{ | |||
$post = $this->getDoctrine() | |||
->getRepository('AppBundle:Post') | |||
->findOneBy(array('slug' => $postSlug)); | |||
->findOneBy(array('slug' => $postSlug)) | |||
; |
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 this change, as we are sure ->findOneBy()
will be the last method call in this chain.
@@ -146,7 +147,7 @@ For example: | |||
$deleteForm = $this->createDeleteForm($post); | |||
|
|||
return $this->render('admin/post/show.html.twig', array( | |||
'post' => $post, | |||
'post' => $post, |
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'm 👎 here. The code team decided recently to not align array values. I would just trim the spaces to one single space.
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.
It'll significantly improves readability, which is way more important in the docs than having nice diffs in PRs.
This change gets a very big 👍 from me.
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.
Okay, let's keep it. Readability is a good argument. :)
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 code I'm personally not a big fan of alligning myself as most of the time it gives more problems than it solves.
For documentation, I think it's a really good idea to improve readability as you want to make docs as easy to digest as possible (I'm currently rereading parts of PHP documentation, and .... it's not great, but as someone with experience I can slip past those problems, but for newcomers it might be a mine field).
👍 |
thank you for fixing and improving the code, Andrew! |