qrcode.chapril.org-libreqr/vendor/wikimedia/less.php/lib/Less/Tree/Value.php

47 lines
814 B
PHP
Raw Normal View History

2021-02-15 21:29:38 +01:00
<?php
/**
2023-07-07 22:33:10 +02:00
* @private
2021-02-15 21:29:38 +01:00
*/
class Less_Tree_Value extends Less_Tree {
public $type = 'Value';
public $value;
2023-07-07 22:33:10 +02:00
/**
* @param array<Less_Tree> $value
*/
2021-02-15 21:29:38 +01:00
public function __construct( $value ) {
$this->value = $value;
}
public function accept( $visitor ) {
$this->value = $visitor->visitArray( $this->value );
}
public function compile( $env ) {
2023-07-07 22:33:10 +02:00
$ret = [];
2021-02-15 21:29:38 +01:00
$i = 0;
foreach ( $this->value as $i => $v ) {
$ret[] = $v->compile( $env );
}
if ( $i > 0 ) {
return new Less_Tree_Value( $ret );
}
return $ret[0];
}
/**
* @see Less_Tree::genCSS
*/
function genCSS( $output ) {
$len = count( $this->value );
for ( $i = 0; $i < $len; $i++ ) {
$this->value[$i]->genCSS( $output );
if ( $i + 1 < $len ) {
$output->add( Less_Environment::$_outputMap[','] );
}
}
}
}