@@ -66,36 +66,42 @@ |
||
| 66 | 66 | $this->appendBlockText(str_replace("\n", " ", $data)); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - public function getText() { |
|
| 69 | + public function getText() |
|
| 70 | + { |
|
| 70 | 71 | $text = trim($this->text); |
| 71 | 72 | $lines = explode("\n", $text); |
| 72 | 73 | |
| 73 | 74 | return implode("\n", array_map("trim", $lines)); |
| 74 | 75 | } |
| 75 | 76 | |
| 76 | - private function appendBlockText($value) { |
|
| 77 | + private function appendBlockText($value) |
|
| 78 | + { |
|
| 77 | 79 | $this->setBlockText($this->getBlockText() . $value); |
| 78 | 80 | } |
| 79 | 81 | |
| 80 | 82 | /** |
| 81 | 83 | * @param string $value |
| 82 | 84 | */ |
| 83 | - private function setBlockText($value) { |
|
| 85 | + private function setBlockText($value) |
|
| 86 | + { |
|
| 84 | 87 | $this->transformedTextStack->pop(); |
| 85 | 88 | $this->transformedTextStack->push($value); |
| 86 | 89 | } |
| 87 | 90 | |
| 88 | - private function getBlockText() { |
|
| 91 | + private function getBlockText() |
|
| 92 | + { |
|
| 89 | 93 | return $this->transformedTextStack->top(); |
| 90 | 94 | } |
| 91 | 95 | |
| 92 | - private function blockBegin($name, $attributes) { |
|
| 96 | + private function blockBegin($name, $attributes) |
|
| 97 | + { |
|
| 93 | 98 | $this->transformedTextStack->push(""); |
| 94 | 99 | $this->blockTypeStack->push($name); |
| 95 | 100 | $this->blockAttributesStack->push($attributes); |
| 96 | 101 | } |
| 97 | 102 | |
| 98 | - private function blockFinished() { |
|
| 103 | + private function blockFinished() |
|
| 104 | + { |
|
| 99 | 105 | return $this->transformedTextStack->pop(); |
| 100 | 106 | return $this->blockTypeStack->pop(); |
| 101 | 107 | return $this->blockAttributesStack->pop(); |