44
55namespace Sabberworm \CSS \RuleSet ;
66
7- use Sabberworm \CSS \Comment \Comment ;
8- use Sabberworm \CSS \Comment \Commentable ;
7+ use Sabberworm \CSS \Comment \CommentContainer ;
98use Sabberworm \CSS \CSSList \CSSListItem ;
109use Sabberworm \CSS \OutputFormat ;
1110use Sabberworm \CSS \Parsing \ParserState ;
2827 */
2928abstract class RuleSet implements CSSListItem
3029{
30+ use CommentContainer;
31+
3132 /**
3233 * the rules in this rule set, using the property name as the key,
3334 * with potentially multiple rules per property name.
@@ -43,13 +44,6 @@ abstract class RuleSet implements CSSListItem
4344 */
4445 protected $ lineNumber ;
4546
46- /**
47- * @var list<Comment>
48- *
49- * @internal since 8.8.0
50- */
51- protected $ comments = [];
52-
5347 /**
5448 * @param int<0, max> $lineNumber
5549 */
@@ -299,28 +293,4 @@ protected function renderRules(OutputFormat $outputFormat): string
299293
300294 return $ formatter ->removeLastSemicolon ($ result );
301295 }
302-
303- /**
304- * @param list<Comment> $comments
305- */
306- public function addComments (array $ comments ): void
307- {
308- $ this ->comments = \array_merge ($ this ->comments , $ comments );
309- }
310-
311- /**
312- * @return list<Comment>
313- */
314- public function getComments (): array
315- {
316- return $ this ->comments ;
317- }
318-
319- /**
320- * @param list<Comment> $comments
321- */
322- public function setComments (array $ comments ): void
323- {
324- $ this ->comments = $ comments ;
325- }
326296}
0 commit comments