Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
75.00% covered (warning)
75.00%
3 / 4
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
Less_Tree_Keyword
75.00% covered (warning)
75.00%
3 / 4
50.00% covered (danger)
50.00%
1 / 2
3.14
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 genCSS
66.67% covered (warning)
66.67%
2 / 3
0.00% covered (danger)
0.00%
0 / 1
2.15
1<?php
2declare( strict_types = 1 );
3
4/**
5 * @private
6 */
7class Less_Tree_Keyword extends Less_Tree implements Less_Tree_HasValueProperty {
8
9    /** @var string */
10    public $value;
11
12    /**
13     * @param string $value
14     */
15    public function __construct( $value ) {
16        $this->value = $value;
17    }
18
19    /**
20     * @see Less_Tree::genCSS
21     */
22    public function genCSS( $output ) {
23        if ( $this->value === '%' ) {
24            throw new Less_Exception_Compiler( "Invalid % without number" );
25        }
26
27        $output->add( $this->value );
28    }
29}