Output.php 749 B

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