10
10
use Sabberworm \CSS \Parsing \SourceException ;
11
11
use Sabberworm \CSS \Parsing \UnexpectedEOFException ;
12
12
use Sabberworm \CSS \Parsing \UnexpectedTokenException ;
13
+ use Sabberworm \CSS \Position \Position ;
14
+ use Sabberworm \CSS \Position \Positionable ;
13
15
use Sabberworm \CSS \Property \AtRule ;
14
16
use Sabberworm \CSS \Property \Charset ;
15
17
use Sabberworm \CSS \Property \CSSNamespace ;
33
35
* Note that `CSSListItem` extends both `Commentable` and `Renderable`,
34
36
* so those interfaces must also be implemented by concrete subclasses.
35
37
*/
36
- abstract class CSSList implements CSSListItem
38
+ abstract class CSSList implements CSSListItem, Positionable
37
39
{
38
40
use CommentContainer;
41
+ use Position;
39
42
40
43
/**
41
44
* @var array<int<0, max>, CSSListItem>
@@ -44,19 +47,12 @@ abstract class CSSList implements CSSListItem
44
47
*/
45
48
protected $ contents = [];
46
49
47
- /**
48
- * @var int<0, max>
49
- *
50
- * @internal since 8.8.0
51
- */
52
- protected $ lineNumber ;
53
-
54
50
/**
55
51
* @param int<0, max> $lineNumber
56
52
*/
57
53
public function __construct (int $ lineNumber = 0 )
58
54
{
59
- $ this ->lineNumber = $ lineNumber ;
55
+ $ this ->setPosition ( $ lineNumber) ;
60
56
}
61
57
62
58
/**
@@ -250,14 +246,6 @@ private static function identifierIs(string $identifier, string $match): bool
250
246
?: \preg_match ("/^(- \\w+-)? $ match$/i " , $ identifier ) === 1 ;
251
247
}
252
248
253
- /**
254
- * @return int<0, max>
255
- */
256
- public function getLineNo (): int
257
- {
258
- return $ this ->lineNumber ;
259
- }
260
-
261
249
/**
262
250
* Prepends an item to the list of contents.
263
251
*/
0 commit comments