[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/lessphp/Tree/ -> Keyword.php (source)

   1  <?php
   2  
   3  /**
   4   * Keyword
   5   *
   6   * @package Less
   7   * @subpackage tree
   8   */
   9  class Less_Tree_Keyword extends Less_Tree{
  10  
  11      public $value;
  12      public $type = 'Keyword';
  13  
  14      /**
  15       * @param string $value
  16       */
  17  	public function __construct($value){
  18          $this->value = $value;
  19      }
  20  
  21  	public function compile(){
  22          return $this;
  23      }
  24  
  25      /**
  26       * @see Less_Tree::genCSS
  27       */
  28  	public function genCSS( $output ){
  29  
  30          if( $this->value === '%') {
  31              throw new Less_Exception_Compiler("Invalid % without number");
  32          }
  33  
  34          $output->add( $this->value );
  35      }
  36  
  37  	public function compare($other) {
  38          if ($other instanceof Less_Tree_Keyword) {
  39              return $other->value === $this->value ? 0 : 1;
  40          } else {
  41              return -1;
  42          }
  43      }
  44  }


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1