Skip to content

Commit c00e588

Browse files
authored
[TASK] Add visibility to all class/interface constants (MyIntervals#470)
This is a pre-patch to switching to the PER2 coding standard.
1 parent 8bb6080 commit c00e588

File tree

8 files changed

+15
-13
lines changed

8 files changed

+15
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1111

1212
### Changed
1313

14+
- Add visibility to all class/interface constants (#469)
15+
1416
### Deprecated
1517

1618
### Removed

src/Parsing/ParserState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ParserState
1010
/**
1111
* @var null
1212
*/
13-
const EOF = null;
13+
public const EOF = null;
1414

1515
/**
1616
* @var Settings

src/Property/AtRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ interface AtRule extends Renderable, Commentable
1313
*
1414
* @var string
1515
*/
16-
const BLOCK_RULES = 'media/document/supports/region-style/font-feature-values';
16+
public const BLOCK_RULES = 'media/document/supports/region-style/font-feature-values';
1717

1818
/**
1919
* … and more font-specific ones (to be used inside font-feature-values)
2020
*
2121
* @var string
2222
*/
23-
const SET_RULES = 'font-face/counter-style/page/swash/styleset/annotation';
23+
public const SET_RULES = 'font-face/counter-style/page/swash/styleset/annotation';
2424

2525
/**
2626
* @return string|null

src/Property/KeyframeSelector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class KeyframeSelector extends Selector
99
*
1010
* @var string
1111
*/
12-
const SELECTOR_VALIDATION_RX = '/
12+
public const SELECTOR_VALIDATION_RX = '/
1313
^(
1414
(?:
1515
[a-zA-Z0-9\x{00A0}-\x{FFFF}_^$|*="\'~\[\]()\-\s\.:#+>]* # any sequence of valid unescaped characters

src/Property/Selector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Selector
1313
*
1414
* @var string
1515
*/
16-
const NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX = '/
16+
private const NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX = '/
1717
(\.[\w]+) # classes
1818
|
1919
\[(\w+) # attributes
@@ -37,7 +37,7 @@ class Selector
3737
*
3838
* @var string
3939
*/
40-
const ELEMENTS_AND_PSEUDO_ELEMENTS_RX = '/
40+
private const ELEMENTS_AND_PSEUDO_ELEMENTS_RX = '/
4141
((^|[\s\+\>\~]+)[\w]+ # elements
4242
|
4343
\:{1,2}( # pseudo-elements
@@ -50,7 +50,7 @@ class Selector
5050
*
5151
* @var string
5252
*/
53-
const SELECTOR_VALIDATION_RX = '/
53+
public const SELECTOR_VALIDATION_RX = '/
5454
^(
5555
(?:
5656
[a-zA-Z0-9\x{00A0}-\x{FFFF}_^$|*="\'~\[\]()\-\s\.:#+>]* # any sequence of valid unescaped characters

src/Value/CalcFunction.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ class CalcFunction extends CSSFunction
1111
/**
1212
* @var int
1313
*/
14-
const T_OPERAND = 1;
14+
private const T_OPERAND = 1;
1515

1616
/**
1717
* @var int
1818
*/
19-
const T_OPERATOR = 2;
19+
private const T_OPERATOR = 2;
2020

2121
/**
2222
* @param ParserState $oParserState

src/Value/Size.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ class Size extends PrimitiveValue
1717
*
1818
* @var array<int, string>
1919
*/
20-
const ABSOLUTE_SIZE_UNITS = ['px', 'cm', 'mm', 'mozmm', 'in', 'pt', 'pc', 'vh', 'vw', 'vmin', 'vmax', 'rem'];
20+
private const ABSOLUTE_SIZE_UNITS = ['px', 'cm', 'mm', 'mozmm', 'in', 'pt', 'pc', 'vh', 'vw', 'vmin', 'vmax', 'rem'];
2121

2222
/**
2323
* @var array<int, string>
2424
*/
25-
const RELATIVE_SIZE_UNITS = ['%', 'em', 'ex', 'ch', 'fr'];
25+
private const RELATIVE_SIZE_UNITS = ['%', 'em', 'ex', 'ch', 'fr'];
2626

2727
/**
2828
* @var array<int, string>
2929
*/
30-
const NON_SIZE_UNITS = ['deg', 'grad', 'rad', 's', 'ms', 'turn', 'Hz', 'kHz'];
30+
private const NON_SIZE_UNITS = ['deg', 'grad', 'rad', 's', 'ms', 'turn', 'Hz', 'kHz'];
3131

3232
/**
3333
* @var array<int, array<string, string>>|null

tests/OutputFormatTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ final class OutputFormatTest extends TestCase
1616
/**
1717
* @var string
1818
*/
19-
const TEST_CSS = <<<EOT
19+
private const TEST_CSS = <<<EOT
2020
2121
.main, .test {
2222
font: italic normal bold 16px/1.2 "Helvetica", Verdana, sans-serif;

0 commit comments

Comments
 (0)