| 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 CSS declarations and at-rules |
| 11 |
* @extends CSSObjectList<DeclarationOrAtRule> |
| 12 |
*/ |
| 13 |
class DeclarationOrAtRuleList extends CSSObjectList { |
| 14 |
/** |
| 15 |
* @var string |
| 16 |
*/ |
| 17 |
protected static $objectType = DeclarationOrAtRule::class; |
| 18 |
|
| 19 |
/** @inheritDoc */ |
| 20 |
protected function getSeparator( CSSObject $left, ?CSSObject $right = null ) { |
| 21 |
$ret = []; |
| 22 |
if ( $left instanceof Declaration ) { |
| 23 |
$ret[] = new Token( Token::T_SEMICOLON, [ 'significant' => (bool)$right ] ); |
| 24 |
} |
| 25 |
if ( $right ) { |
| 26 |
$ret[] = new Token( Token::T_WHITESPACE, [ 'significant' => false ] ); |
| 27 |
} |
| 28 |
return $ret; |
| 29 |
} |
| 30 |
} |