Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
Less_Tree_Assignment
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 accept
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 compile
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 genCSS
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * @private
4 * @see less-2.5.3.js#Assignment.prototype
5 */
6class Less_Tree_Assignment extends Less_Tree implements Less_Tree_HasValueProperty {
7    public $key;
8    public $value;
9
10    public function __construct( string $key, Less_Tree $val ) {
11        $this->key = $key;
12        $this->value = $val;
13    }
14
15    public function accept( $visitor ) {
16        $this->value = $visitor->visitObj( $this->value );
17    }
18
19    public function compile( $env ) {
20        // NOTE: Less.js has a conditional for $this->value,
21        // but this appears unreachable ($val is not optional).
22        return new self( $this->key, $this->value->compile( $env ) );
23    }
24
25    public function genCSS( $output ) {
26        $output->add( $this->key . '=' );
27        $this->value->genCSS( $output );
28    }
29}