Skip to content

Commit 748a15c

Browse files
committed
[TASK] Mark parsing-internal classes and methods as @internal
Code that uses this library is not expected to call internal parsing functionality. Communicate this with the corresponding `@internal` annotation. This allows us to boldly refactor the parser code. Part of #668
1 parent a64c752 commit 748a15c

8 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1515

1616
### Changed
1717

18+
- Mark parsing-internal classes and methods as `@internal` (#674)
1819
- Block installations on unsupported higher PHP versions (#691)
1920
- Improve performance of Value::parseValue with many delimiters by refactoring to remove array_search() (#413)
2021
- Add visibility to all class/interface constants (#469)

src/Parser.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public function __construct($sText, ?Settings $oParserSettings = null, $iLineNo
3333
* Sets the charset to be used if the CSS does not contain an `@charset` declaration.
3434
*
3535
* @param string $sCharset
36+
*
37+
* @internal
3638
*/
3739
public function setCharset($sCharset): void
3840
{
@@ -41,6 +43,8 @@ public function setCharset($sCharset): void
4143

4244
/**
4345
* Returns the charset that is used if the CSS does not contain an `@charset` declaration.
46+
*
47+
* @internal
4448
*/
4549
public function getCharset(): void
4650
{

src/Parsing/Anchor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace Sabberworm\CSS\Parsing;
44

5+
/**
6+
* @internal
7+
*/
58
class Anchor
69
{
710
/**

src/Parsing/OutputException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
/**
66
* Thrown if the CSS parser attempts to print something invalid.
7+
*
8+
* @internal
79
*/
810
class OutputException extends SourceException
911
{

src/Parsing/ParserState.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
use Sabberworm\CSS\Comment\Comment;
66
use Sabberworm\CSS\Settings;
77

8+
/**
9+
* @internal
10+
*/
811
class ParserState
912
{
1013
/**

src/Parsing/SourceException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
namespace Sabberworm\CSS\Parsing;
44

5+
/**
6+
* @internal
7+
*/
58
class SourceException extends \Exception
69
{
710
/**

src/Parsing/UnexpectedEOFException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66
* Thrown if the CSS parser encounters end of file it did not expect.
77
*
88
* Extends `UnexpectedTokenException` in order to preserve backwards compatibility.
9+
*
10+
* @internal
911
*/
1012
class UnexpectedEOFException extends UnexpectedTokenException {}

src/Parsing/UnexpectedTokenException.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
/**
66
* Thrown if the CSS parser encounters a token it did not expect.
7+
*
8+
* @internal
79
*/
810
class UnexpectedTokenException extends SourceException
911
{

0 commit comments

Comments
 (0)