Skip to content

Commit c3afc42

Browse files
committed
PhpGenerator: whitespace fix
1 parent 58c785e commit c3afc42

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ public function __toString()
136136
. "\n{\n\n"
137137
. Nette\Utils\Strings::indent(
138138
($this->traits ? "use " . implode(', ', (array) $this->traits) . ";\n\n" : '')
139-
. ($this->consts ? implode('', $consts) . "\n" : '')
140-
. ($this->properties ? implode("\n", $properties) . "\n" : '')
139+
. ($this->consts ? implode('', $consts) . "\n\n" : '')
140+
. ($this->properties ? implode("\n", $properties) . "\n\n" : '')
141141
. implode("\n\n\n", $this->methods), 1)
142142
. "\n\n}") . "\n";
143143
}

src/PhpGenerator/Method.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function __toString()
115115
. '(' . implode(', ', $parameters) . ')'
116116
. ($this->uses ? ' use (' . implode(', ', $uses) . ')' : '')
117117
. ($this->abstract || $this->body === FALSE ? ';'
118-
: ($this->name ? "\n" : ' ') . "{\n" . Nette\Utils\Strings::indent($this->body, 1) . "\n}");
118+
: ($this->name ? "\n" : ' ') . "{\n" . Nette\Utils\Strings::indent(trim($this->body), 1) . "\n}");
119119
}
120120

121121
}

tests/PhpGenerator/PhpGenerator.class.expect

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ abstract final class Example extends ParentClass implements IExample, IOne
1212
const ROLE = 'admin';
1313
const FORCE_ARRAY = Nette\Utils\Json::FORCE_ARRAY;
1414

15+
1516
/**
1617
* @var resource orignal file handle
1718
*/
@@ -23,6 +24,7 @@ abstract final class Example extends ParentClass implements IExample, IOne
2324
'first' => TRUE,
2425
);
2526

27+
2628
/**
2729
* Returns file handle.
2830
* @return resource

0 commit comments

Comments
 (0)