Skip to content

Commit 67d866e

Browse files
committed
Generic/LanguageConstructSpacing: fix syntax errors in the XML doc code examples
One of the invalid examples was removed because, besides containing a syntax error, it doesn't trigger the sniff (`yieldfrom` is tokenized as `T_STRING` and this token is not watched by the sniff). The `<code>` title was updated to reflect the remaining examples.
1 parent 50f03b3 commit 67d866e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/Standards/Generic/Docs/WhiteSpace/LanguageConstructSpacingStandard.xml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,18 @@ $newLine;
2929
<code_comparison>
3030
<code title="Valid: Single space between yield and from.">
3131
<![CDATA[
32-
yield<em> </em>from [1, 2, 3];
32+
function myGenerator() {
33+
yield<em> </em>from [1, 2, 3];
34+
}
3335
]]>
3436
</code>
35-
<code title="Invalid: No space, more than one space or newline between yield and from.">
37+
<code title="Invalid: More than one space or newline between yield and from.">
3638
<![CDATA[
37-
yield<em></em>from [1, 2, 3];
38-
yield<em> </em>from [1, 2, 3];
39-
yield<em></em>
40-
from [1, 2, 3];
39+
function myGenerator() {
40+
yield<em> </em>from [1, 2, 3];
41+
yield<em></em>
42+
from [1, 2, 3];
43+
}
4144
]]>
4245
</code>
4346
</code_comparison>

0 commit comments

Comments
 (0)