| 1 |
<?php |
| 2 |
/** |
| 3 |
* Parser output |
| 4 |
* |
| 5 |
* @private |
| 6 |
*/ |
| 7 |
class Less_Output { |
| 8 |
|
| 9 |
/** |
| 10 |
* Output holder |
| 11 |
* |
| 12 |
* @var string[] |
| 13 |
*/ |
| 14 |
protected $strs = []; |
| 15 |
|
| 16 |
/** |
| 17 |
* Adds a chunk to the stack |
| 18 |
* |
| 19 |
* @param string $chunk The chunk to output |
| 20 |
* @param array|null $fileInfo The file information |
| 21 |
* @param int $index The index |
| 22 |
* @param bool|null $mapLines |
| 23 |
*/ |
| 24 |
public function add( $chunk, $fileInfo = null, $index = 0, $mapLines = null ) { |
| 25 |
$this->strs[] = $chunk; |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Converts the output to string |
| 30 |
* |
| 31 |
* @return string |
| 32 |
*/ |
| 33 |
public function toString() { |
| 34 |
return implode( '', $this->strs ); |
| 35 |
} |
| 36 |
|
| 37 |
} |