4 * @license https://opensource.org/licenses/Apache-2.0 Apache-2.0
7 namespace Wikimedia\CSS\Objects;
9 use Wikimedia\CSS\Util;
12 * Represent an abstract CSS rule
14 abstract class Rule implements CSSObject {
16 /** @var int Line and position in the input where this rule starts */
17 protected $line = -1, $pos = -1;
20 * @param Token $token Token starting the rule
22 public function __construct( Token $token ) {
23 list( $this->line, $this->pos ) = $token->getPosition();
27 * Get the position of this Declaration in the input stream
28 * @return array [ $line, $pos ]
30 public function getPosition() {
31 return [ $this->line, $this->pos ];