1 | <?php |
||
14 | class Node |
||
15 | { |
||
16 | /** @var string Selector for node */ |
||
17 | public $selector; |
||
18 | /** @var $this Pointer to parent node */ |
||
19 | public $parent; |
||
20 | /** @var $this [] Collection of nested nodes */ |
||
21 | public $children = array(); |
||
22 | |||
23 | /** |
||
24 | * Create LESS Node |
||
25 | * |
||
26 | * @param string $selector Forced LESS node selector |
||
27 | * @param $this $parent Pointer to parent node |
||
28 | */ |
||
29 | 1 | public function __construct($selector, self &$parent = null) |
|
41 | |||
42 | /** |
||
43 | * Get child node by selector. |
||
44 | * |
||
45 | * @param string $selector Node selector |
||
46 | * |
||
47 | * @return null|$this Node or null if not found |
||
48 | */ |
||
49 | 1 | public function getChild($selector) |
|
57 | |||
58 | /** |
||
59 | * @return string Object string representation |
||
60 | */ |
||
61 | 1 | public function __toString() |
|
65 | } |
||
66 |