Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
Less_Tree_Comment
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
4 / 4
10
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 genCSS
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isSilent
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
7
 markReferenced
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * @private
4 * @see less-2.5.3.js#Comment.prototype
5 */
6class Less_Tree_Comment extends Less_Tree implements Less_Tree_HasValueProperty {
7    public $value;
8    public $isLineComment;
9    public $isReferenced;
10    public $currentFileInfo;
11
12    public function __construct( $value, $isLineComment, $index = null, $currentFileInfo = null ) {
13        $this->value = $value;
14        $this->isLineComment = (bool)$isLineComment;
15        $this->currentFileInfo = $currentFileInfo;
16    }
17
18    public function genCSS( $output ) {
19        // NOTE: Skip debugInfo handling (not implemented)
20
21        $output->add( $this->value );
22    }
23
24    public function isSilent() {
25        $isReference = ( $this->currentFileInfo && isset( $this->currentFileInfo['reference'] ) && ( !isset( $this->isReferenced ) || !$this->isReferenced ) );
26        $isCompressed = Less_Parser::$options['compress'] && ( $this->value[2] ?? '' ) !== "!";
27        return $this->isLineComment || $isReference || $isCompressed;
28    }
29
30    public function markReferenced() {
31        $this->isReferenced = true;
32    }
33
34}