Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lib/bitter/formats/symphony.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,19 @@ public function process($source) {
}

protected function processTabs() {
while (strstr($this->output, "\t")) {
$this->output = preg_replace_callback('%^([^\t]*)(\t+)%', array($this, 'processTabsLine'), $this->output);
// first split the output into manageable chunks
$lines = explode(PHP_EOL, $this->output);
$linesCount = count($lines);
// fix lines one by one
for ($x = 0; $x < $linesCount; $x++) {
// while there are still tabs
while (strpos($lines[$x], "\t") !== FALSE) {
// replace tabs for spaces
$lines[$x] = preg_replace_callback('%^([^\t]*)([\t]+)%', array($this, 'processTabsLine'), $lines[$x]);
}
}
// concat the final output
$this->output = implode(PHP_EOL, $lines);
}

protected function processTabsLine($matches) {
Expand Down