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