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
Prior to PHP 7.1, class constants could not have visibility declared and would always be public. As of PHP 7.1, there is a choice between declaring class constants as public, protected or private.
Related PHPCompatibility sniff(s):
NewConstVisibility
PHP manual references:
As of PHP 7.1.0, class constants may be defined as public, private, or protected. Constants declared without any explicit visibility keyword are defined as public.
Short description of the sniff
Prior to PHP 7.1, class constants could not have visibility declared and would always be public. As of PHP 7.1, there is a choice between declaring class constants as
public
,protected
orprivate
.Related PHPCompatibility sniff(s):
NewConstVisibility
PHP manual references:
http://php.net/manual/en/language.oop5.visibility.php#language.oop5.visiblity-constants
http://php.net/manual/en/migration71.new-features.php#migration71.new-features.class-constant-visibility
http://php.net/manual/en/language.oop5.constants.php
Example code:
Detect the following code pattern(s):
And fix these to:
Notes for implementation of the sniff:
const
keyword will need to be carefully checked.The text was updated successfully, but these errors were encountered: