-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDeclaration.php
More file actions
63 lines (56 loc) · 1.57 KB
/
Declaration.php
File metadata and controls
63 lines (56 loc) · 1.57 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace PostCSS;
/**
* Represents a CSS declaration.
*
* @example
* $root = \PostCSS\Parser::parse('a { color: black }');
* $decl = $root->first->first;
* $decl->type //=> 'decl'
* (string) $decl //=> ' color: black'
*
* @link https://github.com/postcss/postcss/blob/master/lib/declaration.es6
*/
class Declaration extends Node
{
public $important = null;
public $prop = null;
public $value = null;
public function __construct(array $defaults = [])
{
parent::__construct($defaults);
$this->type = 'decl';
}
/**
* @deprecated Declaration->_value was deprecated. Use Declaration->raws->value
* @deprecated Declaration->_important was deprecated. Use Declaration->raws->important
*/
public function __get($name)
{
switch ($name) {
case '_value':
return $this->raws->value;
case '_important':
return $this->raws->important;
default:
return parent::__get($name);
}
}
/**
* @deprecated Declaration->_value was deprecated. Use Declaration->raws->value
* @deprecated Declaration->_important was deprecated. Use Declaration->raws->important
*/
public function __set($name, $value)
{
switch ($name) {
case '_value':
$this->raws->value = $value;
break;
case '_important':
$this->raws->important = $value;
break;
default:
return parent::__set($name);
}
}
}