Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
Less_Tree_NameValue
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 4
56
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 genCSS
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
20
 compile
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 makeImportant
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * A simple CSS name-value pair, e.g. `width: 100px;`
4 *
5 * In bootstrap, there are about 600-1000 simple name-value pairs (depending on
6 * how forgiving the match is) -vs- 6,020 dynamic rules (Less_Tree_Rule).
7 *
8 * Using the name-value object can speed up bootstrap compilation slightly, but
9 * it breaks color keyword interpretation: `color: red` -> `color: #FF0000`.
10 *
11 * @private
12 */
13class Less_Tree_NameValue extends Less_Tree implements Less_Tree_HasValueProperty {
14
15    public $name;
16    public $value;
17    public $index;
18    public $currentFileInfo;
19    public $important = '';
20
21    public function __construct( $name, $value = null, $index = null, $currentFileInfo = null ) {
22        $this->name = $name;
23        $this->value = $value;
24        $this->index = $index;
25        $this->currentFileInfo = $currentFileInfo;
26    }
27
28    public function genCSS( $output ) {
29        $output->add(
30            $this->name
31            . ( Less_Parser::$options['compress'] ? ':' : ': ' )
32            . $this->value
33            . $this->important
34            . ( ( ( Less_Environment::$lastRule && Less_Parser::$options['compress'] ) ) ? "" : ";" ),
35             $this->currentFileInfo, $this->index );
36    }
37
38    public function compile( $env ) {
39        return $this;
40    }
41
42    public function makeImportant() {
43        $new = new self( $this->name, $this->value, $this->index, $this->currentFileInfo );
44        $new->important = ' !important';
45        return $new;
46    }
47
48}