Skip to content
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

Docs/WordPress.WhiteSpace.ControlStructureSpacing #1736

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions WordPress/Docs/WhiteSpace/ControlStructureSpacingStandard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<documentation title="Control Structure Spacing">
<standard>
<![CDATA[
Use spaces around logical operators and assignments.
]]>
</standard>
<code_comparison>
<code title="Valid: space after opening control structure.">
<![CDATA[
while<em> (</em> have_posts() ) {}
]]>
</code>
<code title="Invalid: no space after opening control structure.">
<![CDATA[
while<em>(</em> have_posts() ) {}
]]>
</code>
</code_comparison>
<code_comparison>
<code title="Valid: space after closing parenthesis.">
<![CDATA[
if ( $a === $b <em>) </em>{
// ...
}
]]>
</code>
<code title="Invalid: newline after closing parenthesis.">
<![CDATA[
if ( $a === $b <em>)
{</em>
// ...
}
]]>
</code>
</code_comparison>
</documentation>