You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Standards/PSR2/Docs/Classes/PropertyDeclarationStandard.xml
+20-1Lines changed: 20 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
<documentationtitle="Property Declarations">
2
2
<standard>
3
3
<![CDATA[
4
-
Property names should not be prefixed with an underscore to indicate visibility. Visibility should be used to declare properties rather than the var keyword. Only one property should be declared within a statement.
4
+
Property names should not be prefixed with an underscore to indicate visibility. Visibility should be used to declare properties rather than the var keyword. Only one property should be declared within a statement. The static declaration must come after the visibility declaration.
5
5
]]>
6
6
</standard>
7
7
<code_comparison>
@@ -55,6 +55,25 @@ class Foo
55
55
class Foo
56
56
{
57
57
private <em>$bar, $baz</em>;
58
+
}
59
+
]]>
60
+
</code>
61
+
</code_comparison>
62
+
<code_comparison>
63
+
<codetitle="Valid: If declared as static, the static declaration must come after the visibility declaration.">
64
+
<![CDATA[
65
+
class Foo
66
+
{
67
+
public <em>static</em> $bar;
68
+
private $baz;
69
+
}
70
+
]]>
71
+
</code>
72
+
<codetitle="Invalid: Static declaration before the visibility declaration.">
0 commit comments