vendor/wikimedia/less.php/lib/Less/Tree/Directive.php line 20

Open in your IDE?
  1. <?php
  2. /**
  3.  * Directive
  4.  *
  5.  * @package Less
  6.  * @subpackage tree
  7.  */
  8. class Less_Tree_Directive extends Less_Tree{
  9.     public $name;
  10.     public $value;
  11.     public $rules;
  12.     public $index;
  13.     public $isReferenced;
  14.     public $currentFileInfo;
  15.     public $debugInfo;
  16.     public $type 'Directive';
  17.     public function __construct($name$value null$rules$index null$currentFileInfo null$debugInfo null ){
  18.         $this->name $name;
  19.         $this->value $value;
  20.         if( $rules ){
  21.             $this->rules $rules;
  22.             $this->rules->allowImports true;
  23.         }
  24.         $this->index $index;
  25.         $this->currentFileInfo $currentFileInfo;
  26.         $this->debugInfo $debugInfo;
  27.     }
  28.     public function accept$visitor ){
  29.         if( $this->rules ){
  30.             $this->rules $visitor->visitObj$this->rules );
  31.         }
  32.         if( $this->value ){
  33.             $this->value $visitor->visitObj$this->value );
  34.         }
  35.     }
  36.     /**
  37.      * @see Less_Tree::genCSS
  38.      */
  39.     public function genCSS$output ){
  40.         $value $this->value;
  41.         $rules $this->rules;
  42.         $output->add$this->name$this->currentFileInfo$this->index );
  43.         if( $this->value ){
  44.             $output->add(' ');
  45.             $this->value->genCSS($output);
  46.         }
  47.         if( $this->rules ){
  48.             Less_Tree::outputRuleset$output, array($this->rules));
  49.         } else {
  50.             $output->add(';');
  51.         }
  52.     }
  53.     public function compile($env){
  54.         $value $this->value;
  55.         $rules $this->rules;
  56.         if( $value ){
  57.             $value $value->compile($env);
  58.         }
  59.         if( $rules ){
  60.             $rules $rules->compile($env);
  61.             $rules->root true;
  62.         }
  63.         return new Less_Tree_Directive$this->name$value$rules$this->index$this->currentFileInfo$this->debugInfo );
  64.     }
  65.     public function variable($name){
  66.         if( $this->rules ){
  67.             return $this->rules->variable($name);
  68.         }
  69.     }
  70.     public function find($selector){
  71.         if( $this->rules ){
  72.             return $this->rules->find($selector$this);
  73.         }
  74.     }
  75.     //rulesets: function () { if (this.rules) return tree.Ruleset.prototype.rulesets.apply(this.rules); },
  76.     public function markReferenced(){
  77.         $this->isReferenced true;
  78.         if( $this->rules ){
  79.             Less_Tree::ReferencedArray($this->rules->rules);
  80.         }
  81.     }
  82. }