Skip to content

Commit f7914f8

Browse files
authored
[TASK] Make all non-private properties @internal (#886)
This communicates clearly that the properties may be removed, renamed or made `private` at any point, and that they should not be accessed directly, but using the accessors instead. Also add a type annotation that was missing. Fixes #881
1 parent d2d1db5 commit f7914f8

File tree

13 files changed

+95
-0
lines changed

13 files changed

+95
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Please also have a look at our
2121

2222
### Changed
2323

24+
- Make all non-private properties `@internal` (#886)
2425
- Use more native type declarations and strict mode
2526
(#641, #772, #774, #778, #804, #841, #873, #875)
2627
- Add visibility to all class/interface constants (#469)

src/CSSList/CSSList.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,22 @@ abstract class CSSList implements Renderable, Commentable
3535
{
3636
/**
3737
* @var array<array-key, Comment>
38+
*
39+
* @internal since 8.8.0
3840
*/
3941
protected $comments;
4042

4143
/**
4244
* @var array<int, RuleSet|CSSList|Import|Charset>
45+
*
46+
* @internal since 8.8.0
4347
*/
4448
protected $contents;
4549

4650
/**
4751
* @var int
52+
*
53+
* @internal since 8.8.0
4854
*/
4955
protected $lineNumber;
5056

src/Comment/Comment.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@ class Comment implements Renderable
1111
{
1212
/**
1313
* @var int
14+
*
15+
* @internal since 8.8.0
1416
*/
1517
protected $lineNumber;
1618

1719
/**
1820
* @var string
21+
*
22+
* @internal since 8.8.0
1923
*/
2024
protected $commentText;
2125

src/OutputFormat.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ class OutputFormat
1010
* Value format: `"` means double-quote, `'` means single-quote
1111
*
1212
* @var string
13+
*
14+
* @internal since 8.8.0, will be made private in 9.0.0
1315
*/
1416
public $sStringQuotingType = '"';
1517

1618
/**
1719
* Output RGB colors in hash notation if possible
1820
*
1921
* @var string
22+
*
23+
* @internal since 8.8.0, will be made private in 9.0.0
2024
*/
2125
public $bRGBHashNotation = true;
2226

@@ -26,6 +30,8 @@ class OutputFormat
2630
* Semicolon after the last rule of a declaration block can be omitted. To do that, set this false.
2731
*
2832
* @var bool
33+
*
34+
* @internal since 8.8.0, will be made private in 9.0.0
2935
*/
3036
public $bSemicolonAfterLastRule = true;
3137

@@ -34,60 +40,84 @@ class OutputFormat
3440
* Note that these strings are not sanity-checked: the value should only consist of whitespace
3541
* Any newline character will be indented according to the current level.
3642
* The triples (After, Before, Between) can be set using a wildcard (e.g. `$oFormat->set('Space*Rules', "\n");`)
43+
*
44+
* @var string
45+
*
46+
* @internal since 8.8.0, will be made private in 9.0.0
3747
*/
3848
public $sSpaceAfterRuleName = ' ';
3949

4050
/**
4151
* @var string
52+
*
53+
* @internal since 8.8.0, will be made private in 9.0.0
4254
*/
4355
public $sSpaceBeforeRules = '';
4456

4557
/**
4658
* @var string
59+
*
60+
* @internal since 8.8.0, will be made private in 9.0.0
4761
*/
4862
public $sSpaceAfterRules = '';
4963

5064
/**
5165
* @var string
66+
*
67+
* @internal since 8.8.0, will be made private in 9.0.0
5268
*/
5369
public $sSpaceBetweenRules = '';
5470

5571
/**
5672
* @var string
73+
*
74+
* @internal since 8.8.0, will be made private in 9.0.0
5775
*/
5876
public $sSpaceBeforeBlocks = '';
5977

6078
/**
6179
* @var string
80+
*
81+
* @internal since 8.8.0, will be made private in 9.0.0
6282
*/
6383
public $sSpaceAfterBlocks = '';
6484

6585
/**
6686
* @var string
87+
*
88+
* @internal since 8.8.0, will be made private in 9.0.0
6789
*/
6890
public $sSpaceBetweenBlocks = "\n";
6991

7092
/**
7193
* Content injected in and around at-rule blocks.
7294
*
7395
* @var string
96+
*
97+
* @internal since 8.8.0, will be made private in 9.0.0
7498
*/
7599
public $sBeforeAtRuleBlock = '';
76100

77101
/**
78102
* @var string
103+
*
104+
* @internal since 8.8.0, will be made private in 9.0.0
79105
*/
80106
public $sAfterAtRuleBlock = '';
81107

82108
/**
83109
* This is what’s printed before and after the comma if a declaration block contains multiple selectors.
84110
*
85111
* @var string
112+
*
113+
* @internal since 8.8.0, will be made private in 9.0.0
86114
*/
87115
public $sSpaceBeforeSelectorSeparator = '';
88116

89117
/**
90118
* @var string
119+
*
120+
* @internal since 8.8.0, will be made private in 9.0.0
91121
*/
92122
public $sSpaceAfterSelectorSeparator = ' ';
93123

@@ -98,13 +128,17 @@ class OutputFormat
98128
* To set the spacing for specific separators, use {@see $aSpaceBeforeListArgumentSeparators} instead.
99129
*
100130
* @var string|array<non-empty-string, string>
131+
*
132+
* @internal since 8.8.0, will be made private in 9.0.0
101133
*/
102134
public $sSpaceBeforeListArgumentSeparator = '';
103135

104136
/**
105137
* Keys are separators (e.g. `,`). Values are the space sequence to insert, or an empty string.
106138
*
107139
* @var array<non-empty-string, string>
140+
*
141+
* @internal since 8.8.0, will be made private in 9.0.0
108142
*/
109143
public $aSpaceBeforeListArgumentSeparators = [];
110144

@@ -115,56 +149,74 @@ class OutputFormat
115149
* To set the spacing for specific separators, use {@see $aSpaceAfterListArgumentSeparators} instead.
116150
*
117151
* @var string|array<non-empty-string, string>
152+
*
153+
* @internal since 8.8.0, will be made private in 9.0.0
118154
*/
119155
public $sSpaceAfterListArgumentSeparator = '';
120156

121157
/**
122158
* Keys are separators (e.g. `,`). Values are the space sequence to insert, or an empty string.
123159
*
124160
* @var array<non-empty-string, string>
161+
*
162+
* @internal since 8.8.0, will be made private in 9.0.0
125163
*/
126164
public $aSpaceAfterListArgumentSeparators = [];
127165

128166
/**
129167
* @var string
168+
*
169+
* @internal since 8.8.0, will be made private in 9.0.0
130170
*/
131171
public $sSpaceBeforeOpeningBrace = ' ';
132172

133173
/**
134174
* Content injected in and around declaration blocks.
135175
*
136176
* @var string
177+
*
178+
* @internal since 8.8.0, will be made private in 9.0.0
137179
*/
138180
public $sBeforeDeclarationBlock = '';
139181

140182
/**
141183
* @var string
184+
*
185+
* @internal since 8.8.0, will be made private in 9.0.0
142186
*/
143187
public $sAfterDeclarationBlockSelectors = '';
144188

145189
/**
146190
* @var string
191+
*
192+
* @internal since 8.8.0, will be made private in 9.0.0
147193
*/
148194
public $sAfterDeclarationBlock = '';
149195

150196
/**
151197
* Indentation character(s) per level. Only applicable if newlines are used in any of the spacing settings.
152198
*
153199
* @var string
200+
*
201+
* @internal since 8.8.0, will be made private in 9.0.0
154202
*/
155203
public $sIndentation = "\t";
156204

157205
/**
158206
* Output exceptions.
159207
*
160208
* @var bool
209+
*
210+
* @internal since 8.8.0, will be made private in 9.0.0
161211
*/
162212
public $bIgnoreExceptions = false;
163213

164214
/**
165215
* Render comments for lists and RuleSets
166216
*
167217
* @var bool
218+
*
219+
* @internal since 8.8.0, will be made private in 9.0.0
168220
*/
169221
public $bRenderComments = false;
170222

src/Property/CSSNamespace.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class CSSNamespace implements AtRule
2929

3030
/**
3131
* @var array<array-key, Comment>
32+
*
33+
* @internal since 8.8.0
3234
*/
3335
protected $comments;
3436

src/Property/Charset.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ class Charset implements AtRule
2525

2626
/**
2727
* @var int
28+
*
29+
* @internal since 8.8.0
2830
*/
2931
protected $lineNumber;
3032

3133
/**
3234
* @var array<array-key, Comment>
35+
*
36+
* @internal since 8.8.0
3337
*/
3438
protected $comments;
3539

src/Property/Import.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ class Import implements AtRule
2525

2626
/**
2727
* @var int
28+
*
29+
* @internal since 8.8.0
2830
*/
2931
protected $lineNumber;
3032

3133
/**
3234
* @var array<array-key, Comment>
35+
*
36+
* @internal since 8.8.0
3337
*/
3438
protected $comments;
3539

src/Rule/Rule.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,15 @@ class Rule implements Renderable, Commentable
4848

4949
/**
5050
* @var int
51+
*
52+
* @internal since 8.8.0
5153
*/
5254
protected $iColNo;
5355

5456
/**
5557
* @var array<array-key, Comment>
58+
*
59+
* @internal since 8.8.0
5660
*/
5761
protected $comments;
5862

src/RuleSet/RuleSet.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@ abstract class RuleSet implements Renderable, Commentable
3131

3232
/**
3333
* @var int
34+
*
35+
* @internal since 8.8.0
3436
*/
3537
protected $lineNumber;
3638

3739
/**
3840
* @var array<array-key, Comment>
41+
*
42+
* @internal since 8.8.0
3943
*/
4044
protected $comments;
4145

src/Settings.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,26 @@ class Settings
1818
* and `mb_strpos` functions. Otherwise, the normal (ASCII-Only) functions will be used.
1919
*
2020
* @var bool
21+
*
22+
* @internal since 8.8.0, will be made private in 9.0.0
2123
*/
2224
public $bMultibyteSupport;
2325

2426
/**
2527
* The default charset for the CSS if no `@charset` declaration is found. Defaults to utf-8.
2628
*
2729
* @var string
30+
*
31+
* @internal since 8.8.0, will be made private in 9.0.0
2832
*/
2933
public $sDefaultCharset = 'utf-8';
3034

3135
/**
3236
* Whether the parser silently ignore invalid rules instead of choking on them.
3337
*
3438
* @var bool
39+
*
40+
* @internal since 8.8.0, will be made private in 9.0.0
3541
*/
3642
public $bLenientParsing = true;
3743

src/Value/CSSFunction.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class CSSFunction extends ValueList
1515
{
1616
/**
1717
* @var string
18+
*
19+
* @internal since 8.8.0
1820
*/
1921
protected $sName;
2022

src/Value/Value.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ abstract class Value implements Renderable
1818
{
1919
/**
2020
* @var int
21+
*
22+
* @internal since 8.8.0
2123
*/
2224
protected $lineNumber;
2325

src/Value/ValueList.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ abstract class ValueList extends Value
1616
{
1717
/**
1818
* @var array<array-key, Value|string>
19+
*
20+
* @internal since 8.8.0
1921
*/
2022
protected $aComponents;
2123

2224
/**
2325
* @var string
26+
*
27+
* @internal since 8.8.0
2428
*/
2529
protected $sSeparator;
2630

0 commit comments

Comments
 (0)