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    /** @var string */
8    public $value;
9    /** @var bool */
10    public $isLineComment;
11    /** @var bool|null */
12    public $isReferenced;
13    /** @var array|null */
14    public $currentFileInfo;
15
16    public function __construct( $value, $isLineComment, $index = null, $currentFileInfo = null ) {
17        $this->value = $value;
18        $this->isLineComment = (bool)$isLineComment;
19        $this->currentFileInfo = $currentFileInfo;
20    }
21
22    public function genCSS( $output ) {
23        // NOTE: Skip debugInfo handling (not implemented)
24
25        $output->add( $this->value );
26    }
27
28    public function isSilent() {
29        $isReference = ( $this->currentFileInfo && isset( $this->currentFileInfo['reference'] ) && ( !isset( $this->isReferenced ) || !$this->isReferenced ) );
30        $isCompressed = Less_Parser::$options['compress'] && ( $this->value[2] ?? '' ) !== "!";
31        return $this->isLineComment || $isReference || $isCompressed;
32    }
33
34    public function markReferenced() {
35        $this->isReferenced = true;
36    }
37
38}