-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Fixed code examples #1531
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
Fixed code examples #1531
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey! I see that you already noticed #1534, which I just merged into 2.0. Can you rebase your commits to include the latest and also make a new PR to the 2.0 branch? You mentioned that this should be merged into the 2.0 branch, but it'll be much easier to review if the PR is against 2.0 since the changeset is so heavy. Thank you! |
I have created a new PR: #1548 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should be merged into the 2.0 branch, NOT the master branch. Excuse me for this mistake.
The code examples on the documentation where a little messy. I have changed all code examples to follow these rules:
Rules
...
in a comment at the point where we fold some code. These comments are:// ...
(php),# ...
(yaml),{# ... #}
(twig),<!-- ... -->
(xml/html),; ...
(ini),...
(text)...
(without comment) at the place of the fold.If we fold some lines: The description can be placed after the
...
If we fold a part of a line: The description can be placed before the line
A very simple example:
Some rules that I haven't included, because it need some more discussion:
::
or the codeblock.. code-block:: php
for php code?$
before every bash line?Points of attention
You should to put a space after
{
and before}
in Yaml (e.g.{ _controller: ... }
), but this should not be done in Twig (e.g.{'hello' : 'value'}
).An array item is a piece of a line, not a total line. So don't use
// ...
but...,
(the comma because of the Coding Standards):Because I have seen hunderts lines of code it is sure that I have missed some mistakes, so feel free to solve it or place a comment so I can solve it.