forked from Surachai-kent/css-sanitizer
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRule.php
More file actions
34 lines (28 loc) · 722 Bytes
/
Rule.php
File metadata and controls
34 lines (28 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/**
* @file
* @license https://opensource.org/licenses/Apache-2.0 Apache-2.0
*/
namespace Wikimedia\CSS\Objects;
/**
* Represent an abstract CSS rule
*/
abstract class Rule implements CSSObject {
/** @var int Line in the input where this rule starts */
protected $line = -1;
/** @var int Position in the input where this rule starts */
protected $pos = -1;
/**
* @param Token $token Token starting the rule
*/
public function __construct( Token $token ) {
[ $this->line, $this->pos ] = $token->getPosition();
}
/**
* Get the position of this Declaration in the input stream
* @return array [ $line, $pos ]
*/
public function getPosition() {
return [ $this->line, $this->pos ];
}
}