Merge pull request #493 from nmpolo/codegenerationfixes
Do not add trailing whitespace to blank lines
This commit is contained in:
commit
a44579303c
@ -364,7 +364,7 @@ public function __construct()
|
|||||||
$body = str_replace('<spaces>', $this->spaces, $body);
|
$body = str_replace('<spaces>', $this->spaces, $body);
|
||||||
$last = strrpos($currentCode, '}');
|
$last = strrpos($currentCode, '}');
|
||||||
|
|
||||||
return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : ''). "}";
|
return substr($currentCode, 0, $last) . $body . (strlen($body) > 0 ? "\n" : ''). "}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1213,8 +1213,10 @@ public function __construct()
|
|||||||
$lines = explode("\n", $code);
|
$lines = explode("\n", $code);
|
||||||
|
|
||||||
foreach ($lines as $key => $value) {
|
foreach ($lines as $key => $value) {
|
||||||
|
if ( ! empty($value)) {
|
||||||
$lines[$key] = str_repeat($this->spaces, $num) . $lines[$key];
|
$lines[$key] = str_repeat($this->spaces, $num) . $lines[$key];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return implode("\n", $lines);
|
return implode("\n", $lines);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user