Skip to content

Commit

Permalink
[TASK] Mark all class constants as @internal (#500)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
oliverklee authored Feb 24, 2024
1 parent eed92ad commit b48925e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).

### Changed

- Mark all class constants as `@internal` (#500)

### Deprecated

### Removed
Expand Down
2 changes: 2 additions & 0 deletions src/Parsing/ParserState.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ class ParserState
{
/**
* @var null
*
* @internal
*/
const EOF = null;

Expand Down
4 changes: 4 additions & 0 deletions src/Property/AtRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ 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';

/**
* … 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';

Expand Down
2 changes: 2 additions & 0 deletions src/Property/KeyframeSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class KeyframeSelector extends Selector
* regexp for specificity calculations
*
* @var string
*
* @internal
*/
const SELECTOR_VALIDATION_RX = '/
^(
Expand Down
6 changes: 6 additions & 0 deletions src/Property/Selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class Selector
* regexp for specificity calculations
*
* @var string
*
* @internal
*/
const NON_ID_ATTRIBUTES_AND_PSEUDO_CLASSES_RX = '/
(\.[\w]+) # classes
Expand All @@ -36,6 +38,8 @@ class Selector
* regexp for specificity calculations
*
* @var string
*
* @internal
*/
const ELEMENTS_AND_PSEUDO_ELEMENTS_RX = '/
((^|[\s\+\>\~]+)[\w]+ # elements
Expand All @@ -49,6 +53,8 @@ class Selector
* regexp for specificity calculations
*
* @var string
*
* @internal
*/
const SELECTOR_VALIDATION_RX = '/
^(
Expand Down
4 changes: 4 additions & 0 deletions src/Value/CalcFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ class CalcFunction extends CSSFunction
{
/**
* @var int
*
* @internal
*/
const T_OPERAND = 1;

/**
* @var int
*
* @internal
*/
const T_OPERATOR = 2;

Expand Down
6 changes: 6 additions & 0 deletions src/Value/Size.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, string>
*
* @internal
*/
const ABSOLUTE_SIZE_UNITS = ['px', 'cm', 'mm', 'mozmm', 'in', 'pt', 'pc', 'vh', 'vw', 'vmin', 'vmax', 'rem'];

/**
* @var array<int, string>
*
* @internal
*/
const RELATIVE_SIZE_UNITS = ['%', 'em', 'ex', 'ch', 'fr'];

/**
* @var array<int, string>
*
* @internal
*/
const NON_SIZE_UNITS = ['deg', 'grad', 'rad', 's', 'ms', 'turn', 'Hz', 'kHz'];

Expand Down

0 comments on commit b48925e

Please sign in to comment.