Debian Codegraph @

vendor/wikimedia/css-sanitizer/src/Objects/DeclarationList.php

raw
1 <?php
2 /**
3 * @file
4 * @license https://opensource.org/licenses/Apache-2.0 Apache-2.0
5 */
6
7 namespace Wikimedia\CSS\Objects;
8
9 /**
10 * Represent a list of declarations, eg. `margin: 10px 20px; color: red; display: block;`
11 * @extends CSSObjectList<Declaration>
12 */
13 class DeclarationList extends CSSObjectList {
14 /**
15 * @var string
16 */
17 protected static $objectType = Declaration::class;
18
19 /** @inheritDoc */
20 protected function getSeparator( CSSObject $left, ?CSSObject $right = null ) {
21 if ( $right ) {
22 return [
23 new Token( Token::T_SEMICOLON ),
24 new Token( Token::T_WHITESPACE, [ 'significant' => false ] ),
25 ];
26 }
27
28 return [ new Token( Token::T_SEMICOLON, [ 'significant' => false ] ) ];
29 }
30 }