Skip to content

Commit

Permalink
[Documentation] PSR12 - Constant Visiblity (#238)
Browse files Browse the repository at this point in the history
* Add the documentation for the PSR12 Constant Visiblity sniff
  • Loading branch information
dingo-d authored and jrfnl committed Jan 13, 2024
1 parent ebdce42 commit 5e4c618
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Standards/PSR12/Docs/Properties/ConstantVisibilityStandard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<documentation title="Constant Visibility">
<standard>
<![CDATA[
Visibility must be declared on all class constants if your project PHP minimum version supports constant visibilities (PHP 7.1 or later).
The term "class" refers to all classes, interfaces, enums and traits.
]]>
</standard>
<code_comparison>
<code title="Valid: Constant visibility declared.">
<![CDATA[
class Foo
{
<em>private const</em> BAR = 'bar';
}
]]>
</code>
<code title="Invalid: Constant visibility not declared.">
<![CDATA[
class Foo
{
<em>const</em> BAR = 'bar';
}
]]>
</code>
</code_comparison>
</documentation>

0 comments on commit 5e4c618

Please # to comment.