Skip to content

Commit ec17397

Browse files
committed
NullableTypeDeclaration: fix CLI documentation
* The line length of the code samples was too long. * The second code sample would not be shown as it was not accompanied by a `valid` case, nor wrapped in its own `code_comparison` block.
1 parent bb50f79 commit ec17397

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/Standards/PSR12/Docs/Functions/NullableTypeDeclarationStandard.xml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,34 @@
77
<code_comparison>
88
<code title="Valid: no whitespace used.">
99
<![CDATA[
10-
public function functionName(?string $arg1, ?int $arg2): ?string
11-
{
10+
public function functionName(
11+
?string $arg1,
12+
?int $arg2
13+
): ?string {
1214
}
1315
]]>
1416
</code>
1517
<code title="Invalid: superfluous whitespace used.">
1618
<![CDATA[
17-
public function functionName(? string $arg1, ? int $arg2): ? string
19+
public function functionName(
20+
? string $arg1,
21+
? int $arg2
22+
): ? string {
23+
}
24+
]]>
25+
</code>
26+
</code_comparison>
27+
<code_comparison>
28+
<code title="Valid: no unexpected characters.">
29+
<![CDATA[
30+
public function foo(?int $arg): ?string
1831
{
1932
}
2033
]]>
2134
</code>
2235
<code title="Invalid: unexpected characters used.">
2336
<![CDATA[
24-
public function functionName(? /* nullable for a reason */ string $arg1): ?
37+
public function bar(? /* comment */ int $arg): ?
2538
// nullable for a reason
2639
string
2740
{

0 commit comments

Comments
 (0)