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