Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
DeclarationOrAtRuleList | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
1 / 1 |
getSeparator | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
3 |
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 | */ |
12 | class DeclarationOrAtRuleList extends CSSObjectList { |
13 | /** |
14 | * @var string |
15 | */ |
16 | protected static $objectType = DeclarationOrAtRule::class; |
17 | |
18 | /** @inheritDoc */ |
19 | protected function getSeparator( CSSObject $left, CSSObject $right = null ) { |
20 | $ret = []; |
21 | if ( $left instanceof Declaration ) { |
22 | $ret[] = new Token( Token::T_SEMICOLON, [ 'significant' => (bool)$right ] ); |
23 | } |
24 | if ( $right ) { |
25 | $ret[] = new Token( Token::T_WHITESPACE, [ 'significant' => false ] ); |
26 | } |
27 | return $ret; |
28 | } |
29 | } |