Skip to content

Commit bf29766

Browse files
committed
Added visibility to all the exisiting constant
1 parent 8bcf8c9 commit bf29766

7 files changed

+21
-24
lines changed

Magento2/Sniffs/Classes/DiscouragedDependenciesSniff.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
class DiscouragedDependenciesSniff implements Sniff
1717
{
18-
const CONSTRUCT_METHOD_NAME = '__construct';
18+
private const CONSTRUCT_METHOD_NAME = '__construct';
1919

2020
/**
2121
* String representation of warning.

Magento2/Sniffs/Html/HtmlDirectiveSniff.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
*/
1717
class HtmlDirectiveSniff implements Sniff
1818
{
19-
const CONSTRUCTION_DEPEND_PATTERN = '/{{depend\s*(.*?)}}(.*?){{\\/depend\s*}}/si';
20-
const CONSTRUCTION_IF_PATTERN = '/{{if\s*(.*?)}}(.*?)({{else}}(.*?))?{{\\/if\s*}}/si';
21-
const LOOP_PATTERN = '/{{for(?P<loopItem>.*? )(in)(?P<loopData>.*?)}}(?P<loopBody>.*?){{\/for}}/si';
22-
const CONSTRUCTION_PATTERN = '/{{([a-z]{0,10})(.*?)}}(?:(.*?)(?:{{\/(?:\\1)}}))?/si';
19+
private const CONSTRUCTION_DEPEND_PATTERN = '/{{depend\s*(.*?)}}(.*?){{\\/depend\s*}}/si';
20+
private const CONSTRUCTION_IF_PATTERN = '/{{if\s*(.*?)}}(.*?)({{else}}(.*?))?{{\\/if\s*}}/si';
21+
private const LOOP_PATTERN = '/{{for(?P<loopItem>.*? )(in)(?P<loopData>.*?)}}(?P<loopBody>.*?){{\/for}}/si';
22+
private const CONSTRUCTION_PATTERN = '/{{([a-z]{0,10})(.*?)}}(?:(.*?)(?:{{\/(?:\\1)}}))?/si';
2323

2424
/**
2525
* @var array

Magento2/Sniffs/Less/CommentLevelsSniff.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
*/
2020
class CommentLevelsSniff implements Sniff
2121
{
22-
const COMMENT_STRING = '//';
22+
private const COMMENT_STRING = '//';
2323

24-
const FIRST_LEVEL_COMMENT = '_____________________________________________';
24+
private const FIRST_LEVEL_COMMENT = '_____________________________________________';
2525

26-
const SECOND_LEVEL_COMMENT = '--';
26+
private const SECOND_LEVEL_COMMENT = '--';
2727

2828
/**
2929
* @var array

Magento2/Sniffs/Less/TokenizerSymbolsInterface.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
*/
1111
interface TokenizerSymbolsInterface
1212
{
13-
const TOKENIZER_CSS = 'CSS';
13+
public const TOKENIZER_CSS = 'CSS';
1414

1515
/**#@+
1616
* Symbols for usage into Sniffers
1717
*/
18-
const BITWISE_AND = '&';
19-
const COLON = ';';
20-
const OPEN_PARENTHESIS = '(';
21-
const CLOSE_PARENTHESIS = ')';
22-
const NEW_LINE = "\n";
23-
const WHITESPACE = ' ';
24-
const DOUBLE_WHITESPACE = ' ';
25-
const INDENT_SPACES = ' ';
18+
public const BITWISE_AND = '&';
19+
public const COLON = ';';
20+
public const OPEN_PARENTHESIS = '(';
21+
public const CLOSE_PARENTHESIS = ')';
22+
public const NEW_LINE = "\n";
23+
public const WHITESPACE = ' ';
24+
public const DOUBLE_WHITESPACE = ' ';
25+
public const INDENT_SPACES = ' ';
2626
/**#@-*/
2727
}

Magento2/Sniffs/Less/ZeroUnitsSniff.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
*/
2020
class ZeroUnitsSniff implements Sniff
2121
{
22-
const CSS_PROPERTY_UNIT_PX = 'px';
23-
const CSS_PROPERTY_UNIT_EM = 'em';
24-
const CSS_PROPERTY_UNIT_REM = 'rem';
22+
private const CSS_PROPERTY_UNIT_PX = 'px';
23+
private const CSS_PROPERTY_UNIT_EM = 'em';
24+
private const CSS_PROPERTY_UNIT_REM = 'rem';
2525

2626
/**
2727
* @var array

Magento2/Sniffs/Methods/DeprecatedModelMethodSniff.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class DeprecatedModelMethodSniff implements Sniff
1515
{
16-
const RESOURCE_METHOD = "getResource";
16+
private const RESOURCE_METHOD = "getResource";
1717

1818
/**
1919
* String representation of warning.

Magento2/ruleset.xml

-3
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,5 @@
735735
<rule ref="PSR12.Properties.ConstantVisibility">
736736
<severity>5</severity>
737737
<type>warning</type>
738-
<exclude-pattern>*/_files/*</exclude-pattern>
739-
<exclude-pattern>*/Test/*</exclude-pattern>
740-
<exclude-pattern>*Test.php</exclude-pattern>
741738
</rule>
742739
</ruleset>

0 commit comments

Comments
 (0)