Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
7 / 7
Wikimedia\CSS\Objects\ComponentValueList
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
2 / 2
8
100.00% covered (success)
100.00%
7 / 7
 testObjects
100.00% covered (success)
100.00%
1 / 1
7
100.00% covered (success)
100.00%
6 / 6
 toComponentValueArray
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
<?php
/**
 * @file
 * @license https://opensource.org/licenses/Apache-2.0 Apache-2.0
 */
namespace Wikimedia\CSS\Objects;
/**
 * Represent a list of CSS declarations
 */
class ComponentValueList extends CSSObjectList {
    protected static $objectType = ComponentValue::class;
    /** @inheritDoc */
    protected static function testObjects( array $objects ) {
        foreach ( $objects as $object ) {
            $type = $object instanceof Token ? $object->type() : 'n/a';
            switch ( $type ) {
                case Token::T_FUNCTION:
                case Token::T_LEFT_BRACKET:
                case Token::T_LEFT_PAREN:
                case Token::T_LEFT_BRACE:
                    throw new \InvalidArgumentException(
                        static::class . " may not contain tokens of type \"$type\"."
                    );
            }
        }
    }
    /** @inheritDoc */
    public function toComponentValueArray() {
        // Much simpler
        return $this->objects;
    }
}