Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
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 * A base interface for "CSS objects"
13 *
14 * Each object has a position and an ability to be turned into a sequence of
15 * Tokens.
16 */
17interface CSSObject {
18    /**
19     * Get the position of this object in the input stream
20     *
21     * Position is reported as one-based line and one-based codepoint within
22     * the line. If no position is available, returns -1 for both line and
23     * position.
24     *
25     * @return array [ $line, $pos ]
26     */
27    public function getPosition();
28
29    /**
30     * Return an array of Tokens that correspond to this object.
31     * @return Token[]
32     */
33    public function toTokenArray();
34
35    /**
36     * Return an array of ComponentValues that correspond to this object.
37     * @warning Do not return any Tokens that aren't valid in a ComponentValueList.
38     * @return ComponentValue[]
39     */
40    public function toComponentValueArray();
41}