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.CastStructureSpacing #1738

Merged
merged 9 commits into from
Jul 5, 2019
31 changes: 31 additions & 0 deletions WordPress/Docs/WhiteSpace/CastStructureSpacingStandard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<documentation title="Cast Structure Spacing">
<standard>
<![CDATA[
Surround type casts with spaces.
ckanitz marked this conversation as resolved.
Show resolved Hide resolved
]]>
</standard>
<code_comparison>
<code title="Valid: space after typecast.">
ckanitz marked this conversation as resolved.
Show resolved Hide resolved
<![CDATA[
$a = (int) '420';
ckanitz marked this conversation as resolved.
Show resolved Hide resolved
]]>
</code>
<code title="Invalid: no space after typecast.">
<![CDATA[
$a = (int)'420';
ckanitz marked this conversation as resolved.
Show resolved Hide resolved
]]>
</code>
</code_comparison>
<code_comparison>
<code title="Invalid: spaces within typecast.">
ckanitz marked this conversation as resolved.
Show resolved Hide resolved
<![CDATA[
$a = ( int ) '420';
ckanitz marked this conversation as resolved.
Show resolved Hide resolved
]]>
</code>
<code title="Invalid: no space after and spaces within typecast.">
ckanitz marked this conversation as resolved.
Show resolved Hide resolved
<![CDATA[
$a = ( int )'420';
]]>
</code>
</code_comparison>
</documentation>