Skip to content

Commit 2783dde

Browse files
authored
[TASK] Make all non-private properties @internal (#889)
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 This is the V8.x backport of #886.
1 parent a806d0a commit 2783dde

13 files changed

+96
-0
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+
- Make all non-private properties `@internal` (#886)
15+
1416
### Deprecated
1517

1618
- `OutputFormat` properties for space around list separators as an array (#880)

src/CSSList/CSSList.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,22 @@ abstract class CSSList implements Renderable, Commentable
3333
{
3434
/**
3535
* @var array<array-key, Comment>
36+
*
37+
* @internal since 8.8.0
3638
*/
3739
protected $aComments;
3840

3941
/**
4042
* @var array<int, RuleSet|CSSList|Import|Charset>
43+
*
44+
* @internal since 8.8.0
4145
*/
4246
protected $aContents;
4347

4448
/**
4549
* @var int
50+
*
51+
* @internal since 8.8.0
4652
*/
4753
protected $iLineNo;
4854

src/Comment/Comment.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ class Comment implements Renderable
99
{
1010
/**
1111
* @var int
12+
*
13+
* @internal since 8.8.0
1214
*/
1315
protected $iLineNo;
1416

1517
/**
1618
* @var string
19+
*
20+
* @internal since 8.8.0
1721
*/
1822
protected $sComment;
1923

src/OutputFormat.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ class OutputFormat
1414
* Value format: `"` means double-quote, `'` means single-quote
1515
*
1616
* @var string
17+
*
18+
* @internal since 8.8.0, will be made private in 9.0.0
1719
*/
1820
public $sStringQuotingType = '"';
1921

2022
/**
2123
* Output RGB colors in hash notation if possible
2224
*
2325
* @var string
26+
*
27+
* @internal since 8.8.0, will be made private in 9.0.0
2428
*/
2529
public $bRGBHashNotation = true;
2630

@@ -30,6 +34,8 @@ class OutputFormat
3034
* Semicolon after the last rule of a declaration block can be omitted. To do that, set this false.
3135
*
3236
* @var bool
37+
*
38+
* @internal since 8.8.0, will be made private in 9.0.0
3339
*/
3440
public $bSemicolonAfterLastRule = true;
3541

@@ -38,60 +44,84 @@ class OutputFormat
3844
* Note that these strings are not sanity-checked: the value should only consist of whitespace
3945
* Any newline character will be indented according to the current level.
4046
* The triples (After, Before, Between) can be set using a wildcard (e.g. `$oFormat->set('Space*Rules', "\n");`)
47+
*
48+
* @var string
49+
*
50+
* @internal since 8.8.0, will be made private in 9.0.0
4151
*/
4252
public $sSpaceAfterRuleName = ' ';
4353

4454
/**
4555
* @var string
56+
*
57+
* @internal since 8.8.0, will be made private in 9.0.0
4658
*/
4759
public $sSpaceBeforeRules = '';
4860

4961
/**
5062
* @var string
63+
*
64+
* @internal since 8.8.0, will be made private in 9.0.0
5165
*/
5266
public $sSpaceAfterRules = '';
5367

5468
/**
5569
* @var string
70+
*
71+
* @internal since 8.8.0, will be made private in 9.0.0
5672
*/
5773
public $sSpaceBetweenRules = '';
5874

5975
/**
6076
* @var string
77+
*
78+
* @internal since 8.8.0, will be made private in 9.0.0
6179
*/
6280
public $sSpaceBeforeBlocks = '';
6381

6482
/**
6583
* @var string
84+
*
85+
* @internal since 8.8.0, will be made private in 9.0.0
6686
*/
6787
public $sSpaceAfterBlocks = '';
6888

6989
/**
7090
* @var string
91+
*
92+
* @internal since 8.8.0, will be made private in 9.0.0
7193
*/
7294
public $sSpaceBetweenBlocks = "\n";
7395

7496
/**
7597
* Content injected in and around at-rule blocks.
7698
*
7799
* @var string
100+
*
101+
* @internal since 8.8.0, will be made private in 9.0.0
78102
*/
79103
public $sBeforeAtRuleBlock = '';
80104

81105
/**
82106
* @var string
107+
*
108+
* @internal since 8.8.0, will be made private in 9.0.0
83109
*/
84110
public $sAfterAtRuleBlock = '';
85111

86112
/**
87113
* This is what’s printed before and after the comma if a declaration block contains multiple selectors.
88114
*
89115
* @var string
116+
*
117+
* @internal since 8.8.0, will be made private in 9.0.0
90118
*/
91119
public $sSpaceBeforeSelectorSeparator = '';
92120

93121
/**
94122
* @var string
123+
*
124+
* @internal since 8.8.0, will be made private in 9.0.0
95125
*/
96126
public $sSpaceAfterSelectorSeparator = ' ';
97127

@@ -102,13 +132,17 @@ class OutputFormat
102132
* To set the spacing for specific separators, use {@see $aSpaceBeforeListArgumentSeparators} instead.
103133
*
104134
* @var string|array<non-empty-string, string>
135+
*
136+
* @internal since 8.8.0, will be made private in 9.0.0
105137
*/
106138
public $sSpaceBeforeListArgumentSeparator = '';
107139

108140
/**
109141
* Keys are separators (e.g. `,`). Values are the space sequence to insert, or an empty string.
110142
*
111143
* @var array<non-empty-string, string>
144+
*
145+
* @internal since 8.8.0, will be made private in 9.0.0
112146
*/
113147
public $aSpaceBeforeListArgumentSeparators = [];
114148

@@ -119,56 +153,74 @@ class OutputFormat
119153
* To set the spacing for specific separators, use {@see $aSpaceAfterListArgumentSeparators} instead.
120154
*
121155
* @var string|array<non-empty-string, string>
156+
*
157+
* @internal since 8.8.0, will be made private in 9.0.0
122158
*/
123159
public $sSpaceAfterListArgumentSeparator = '';
124160

125161
/**
126162
* Keys are separators (e.g. `,`). Values are the space sequence to insert, or an empty string.
127163
*
128164
* @var array<non-empty-string, string>
165+
*
166+
* @internal since 8.8.0, will be made private in 9.0.0
129167
*/
130168
public $aSpaceAfterListArgumentSeparators = [];
131169

132170
/**
133171
* @var string
172+
*
173+
* @internal since 8.8.0, will be made private in 9.0.0
134174
*/
135175
public $sSpaceBeforeOpeningBrace = ' ';
136176

137177
/**
138178
* Content injected in and around declaration blocks.
139179
*
140180
* @var string
181+
*
182+
* @internal since 8.8.0, will be made private in 9.0.0
141183
*/
142184
public $sBeforeDeclarationBlock = '';
143185

144186
/**
145187
* @var string
188+
*
189+
* @internal since 8.8.0, will be made private in 9.0.0
146190
*/
147191
public $sAfterDeclarationBlockSelectors = '';
148192

149193
/**
150194
* @var string
195+
*
196+
* @internal since 8.8.0, will be made private in 9.0.0
151197
*/
152198
public $sAfterDeclarationBlock = '';
153199

154200
/**
155201
* Indentation character(s) per level. Only applicable if newlines are used in any of the spacing settings.
156202
*
157203
* @var string
204+
*
205+
* @internal since 8.8.0, will be made private in 9.0.0
158206
*/
159207
public $sIndentation = "\t";
160208

161209
/**
162210
* Output exceptions.
163211
*
164212
* @var bool
213+
*
214+
* @internal since 8.8.0, will be made private in 9.0.0
165215
*/
166216
public $bIgnoreExceptions = false;
167217

168218
/**
169219
* Render comments for lists and RuleSets
170220
*
171221
* @var bool
222+
*
223+
* @internal since 8.8.0, will be made private in 9.0.0
172224
*/
173225
public $bRenderComments = false;
174226

src/Property/CSSNamespace.php

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

2828
/**
2929
* @var array<array-key, Comment>
30+
*
31+
* @internal since 8.8.0
3032
*/
3133
protected $aComments;
3234

src/Property/Charset.php

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

2424
/**
2525
* @var int
26+
*
27+
* @internal since 8.8.0
2628
*/
2729
protected $iLineNo;
2830

2931
/**
3032
* @var array<array-key, Comment>
33+
*
34+
* @internal since 8.8.0
3135
*/
3236
protected $aComments;
3337

src/Property/Import.php

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

2424
/**
2525
* @var int
26+
*
27+
* @internal since 8.8.0
2628
*/
2729
protected $iLineNo;
2830

2931
/**
3032
* @var array<array-key, Comment>
33+
*
34+
* @internal since 8.8.0
3135
*/
3236
protected $aComments;
3337

src/Rule/Rule.php

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

4747
/**
4848
* @var int
49+
*
50+
* @internal since 8.8.0
4951
*/
5052
protected $iColNo;
5153

5254
/**
5355
* @var array<array-key, Comment>
56+
*
57+
* @internal since 8.8.0
5458
*/
5559
protected $aComments;
5660

src/RuleSet/RuleSet.php

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

3030
/**
3131
* @var int
32+
*
33+
* @internal since 8.8.0
3234
*/
3335
protected $iLineNo;
3436

3537
/**
3638
* @var array<array-key, Comment>
39+
*
40+
* @internal since 8.8.0
3741
*/
3842
protected $aComments;
3943

src/Settings.php

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

2224
/**
2325
* The default charset for the CSS if no `@charset` declaration is found. Defaults to utf-8.
2426
*
2527
* @var string
28+
*
29+
* @internal since 8.8.0, will be made private in 9.0.0
2630
*/
2731
public $sDefaultCharset = 'utf-8';
2832

2933
/**
3034
* Whether the parser silently ignore invalid rules instead of choking on them.
3135
*
3236
* @var bool
37+
*
38+
* @internal since 8.8.0, will be made private in 9.0.0
3339
*/
3440
public $bLenientParsing = true;
3541

src/Value/CSSFunction.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ class CSSFunction extends ValueList
1313
{
1414
/**
1515
* @var string
16+
*
17+
* @internal since 8.8.0
1618
*/
1719
protected $sName;
1820

src/Value/Value.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ abstract class Value implements Renderable
1616
{
1717
/**
1818
* @var int
19+
*
20+
* @internal since 8.8.0
1921
*/
2022
protected $iLineNo;
2123

src/Value/ValueList.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ abstract class ValueList extends Value
1414
{
1515
/**
1616
* @var array<int, RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string>
17+
*
18+
* @internal since 8.8.0
1719
*/
1820
protected $aComponents;
1921

2022
/**
2123
* @var string
24+
*
25+
* @internal since 8.8.0
2226
*/
2327
protected $sSeparator;
2428

0 commit comments

Comments
 (0)