-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Documentation] PSR12 - Constant Visiblity (#238)
* Add the documentation for the PSR12 Constant Visiblity sniff
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/Standards/PSR12/Docs/Properties/ConstantVisibilityStandard.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |