From f87eac383813abcfe73e82875eb5504e84b4022c Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sat, 24 Feb 2024 13:30:25 +0100 Subject: [PATCH 1/2] [TASK] Mark all class constants as `@internal` This communicates that the constants must not be accessed from outside the project, thus preventing breakage as most of the constants will have a reduced visibility in version 9 (#470). --- CHANGELOG.md | 2 ++ src/Parsing/ParserState.php | 2 ++ src/Property/AtRule.php | 4 ++++ src/Property/KeyframeSelector.php | 2 ++ src/Property/Selector.php | 6 ++++++ src/Value/CalcFunction.php | 4 ++++ src/Value/Size.php | 6 ++++++ 7 files changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9175a1f6..8ce19655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Changed +- Mark all class constants as `@internal` (#494) + ### Deprecated ### Removed diff --git a/src/Parsing/ParserState.php b/src/Parsing/ParserState.php index 7a99f327..07578461 100644 --- a/src/Parsing/ParserState.php +++ b/src/Parsing/ParserState.php @@ -9,6 +9,8 @@ class ParserState { /** * @var null + * + * @internal */ const EOF = null; diff --git a/src/Property/AtRule.php b/src/Property/AtRule.php index 9536ff5e..77b8fd82 100644 --- a/src/Property/AtRule.php +++ b/src/Property/AtRule.php @@ -12,6 +12,8 @@ interface AtRule extends Renderable, Commentable * we’re whitelisting the block rules and have anything else be treated as a set rule. * * @var string + * + * @internal */ const BLOCK_RULES = 'media/document/supports/region-style/font-feature-values'; @@ -19,6 +21,8 @@ interface AtRule extends Renderable, Commentable * … and more font-specific ones (to be used inside font-feature-values) * * @var string + * + * @internal */ const SET_RULES = 'font-face/counter-style/page/swash/styleset/annotation'; diff --git a/src/Property/KeyframeSelector.php b/src/Property/KeyframeSelector.php index 14ea5ebb..9d4795a2 100644 --- a/src/Property/KeyframeSelector.php +++ b/src/Property/KeyframeSelector.php @@ -8,6 +8,8 @@ class KeyframeSelector extends Selector * regexp for specificity calculations * * @var string + * + * @internal */ const SELECTOR_VALIDATION_RX = '/ ^( diff --git a/src/Property/Selector.php b/src/Property/Selector.php index 70c9b2fd..159b64c4 100644 --- a/src/Property/Selector.php +++ b/src/Property/Selector.php @@ -12,6 +12,8 @@ class Selector * regexp for specificity calculations * * @var string + * + * @internal */ const NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX = '/ (\.[\w]+) # classes @@ -36,6 +38,8 @@ class Selector * regexp for specificity calculations * * @var string + * + * @internal */ const ELEMENTS_AND_PSEUDO_ELEMENTS_RX = '/ ((^|[\s\+\>\~]+)[\w]+ # elements @@ -49,6 +53,8 @@ class Selector * regexp for specificity calculations * * @var string + * + * @internal */ const SELECTOR_VALIDATION_RX = '/ ^( diff --git a/src/Value/CalcFunction.php b/src/Value/CalcFunction.php index 5ffd071f..c8791d98 100644 --- a/src/Value/CalcFunction.php +++ b/src/Value/CalcFunction.php @@ -10,11 +10,15 @@ class CalcFunction extends CSSFunction { /** * @var int + * + * @internal */ const T_OPERAND = 1; /** * @var int + * + * @internal */ const T_OPERATOR = 2; diff --git a/src/Value/Size.php b/src/Value/Size.php index 36a32381..19a29d52 100644 --- a/src/Value/Size.php +++ b/src/Value/Size.php @@ -16,16 +16,22 @@ class Size extends PrimitiveValue * vh/vw/vm(ax)/vmin/rem are absolute insofar as they don’t scale to the immediate parent (only the viewport) * * @var array + * + * @internal */ const ABSOLUTE_SIZE_UNITS = ['px', 'cm', 'mm', 'mozmm', 'in', 'pt', 'pc', 'vh', 'vw', 'vmin', 'vmax', 'rem']; /** * @var array + * + * @internal */ const RELATIVE_SIZE_UNITS = ['%', 'em', 'ex', 'ch', 'fr']; /** * @var array + * + * @internal */ const NON_SIZE_UNITS = ['deg', 'grad', 'rad', 's', 'ms', 'turn', 'Hz', 'kHz']; From 228d4b2fd585e2d1d3782cc8fc0663596eec1bad Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sat, 24 Feb 2024 20:34:31 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ce19655..cf362493 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Changed -- Mark all class constants as `@internal` (#494) +- Mark all class constants as `@internal` (#500) ### Deprecated