]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - vendor/oyejorge/less.php/lib/Less/Tree/Anonymous.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / oyejorge / less.php / lib / Less / Tree / Anonymous.php
1 <?php
2
3 /**
4  * Anonymous
5  *
6  * @package Less
7  * @subpackage tree
8  */
9 class Less_Tree_Anonymous extends Less_Tree{
10         public $value;
11         public $quote;
12         public $index;
13         public $mapLines;
14         public $currentFileInfo;
15         public $type = 'Anonymous';
16
17         /**
18          * @param integer $index
19          * @param boolean $mapLines
20          */
21         public function __construct($value, $index = null, $currentFileInfo = null, $mapLines = null ){
22                 $this->value = $value;
23                 $this->index = $index;
24                 $this->mapLines = $mapLines;
25                 $this->currentFileInfo = $currentFileInfo;
26         }
27
28         public function compile(){
29                 return new Less_Tree_Anonymous($this->value, $this->index, $this->currentFileInfo, $this->mapLines);
30         }
31
32     public function compare($x){
33                 if( !is_object($x) ){
34                         return -1;
35                 }
36
37                 $left = $this->toCSS();
38                 $right = $x->toCSS();
39
40                 if( $left === $right ){
41                         return 0;
42                 }
43
44                 return $left < $right ? -1 : 1;
45         }
46
47     /**
48      * @see Less_Tree::genCSS
49      */
50         public function genCSS( $output ){
51                 $output->add( $this->value, $this->currentFileInfo, $this->index, $this->mapLines );
52         }
53
54         public function toCSS(){
55                 return $this->value;
56         }
57
58 }