Skip to content

Commit 7c6d0b1

Browse files
jorritmghoneimy
authored andcommitted
Don't add lines with just 4 spaces
1 parent 20706dd commit 7c6d0b1

20 files changed

+34
-32
lines changed

src/SchemaGenerator/CodeGenerator/CodeFile/TraitFile.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ protected function generateMethods(): string
185185
if (!empty($this->methods)) {
186186
foreach ($this->methods as $method) {
187187
// Indent method with 4 space characters
188-
$method = str_replace("\n", "\n ", $method);
188+
$method = str_replace(PHP_EOL, PHP_EOL . ' ', $method);
189+
// Make lines that were previously empty, empty again.
190+
$method = str_replace(PHP_EOL . ' ' . PHP_EOL, PHP_EOL . PHP_EOL, $method);
189191
$string .= PHP_EOL . ' ' . $method . PHP_EOL;
190192
}
191193
}

tests/files_expected/arguments_objects/WithInputObjectArgArgumentsObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class WithInputObjectArgArgumentsObject extends ArgumentsObject
1111
public function setObjectProperty(SomeInputObject $someInputObject)
1212
{
1313
$this->objectProperty = $someInputObject;
14-
14+
1515
return $this;
1616
}
1717
}

tests/files_expected/arguments_objects/WithListArgArgumentsObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class WithListArgArgumentsObject extends ArgumentsObject
1111
public function setListProperty(array $listProperty)
1212
{
1313
$this->listProperty = $listProperty;
14-
14+
1515
return $this;
1616
}
1717
}

tests/files_expected/arguments_objects/WithMultipleEnumArgArgumentsObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class WithMultipleEnumArgArgumentsObject extends ArgumentsObject
1212
public function setEnumProperty($some)
1313
{
1414
$this->enumProperty = new RawObject($some);
15-
15+
1616
return $this;
1717
}
1818
}

tests/files_expected/arguments_objects/WithMultipleInputObjectArgsArgumentsObject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ class WithMultipleInputObjectArgsArgumentsObject extends ArgumentsObject
1212
public function setObjectProperty(SomeInputObject $someInputObject)
1313
{
1414
$this->objectProperty = $someInputObject;
15-
15+
1616
return $this;
1717
}
1818

1919
public function setAnotherObjectProperty(AnotherInputObject $anotherInputObject)
2020
{
2121
$this->another_object_property = $anotherInputObject;
22-
22+
2323
return $this;
2424
}
2525
}

tests/files_expected/arguments_objects/WithMultipleListArgsArgumentsObject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ class WithMultipleListArgsArgumentsObject extends ArgumentsObject
1212
public function setListProperty(array $listProperty)
1313
{
1414
$this->listProperty = $listProperty;
15-
15+
1616
return $this;
1717
}
1818

1919
public function setAnotherListProperty(array $anotherListProperty)
2020
{
2121
$this->another_list_property = $anotherListProperty;
22-
22+
2323
return $this;
2424
}
2525
}

tests/files_expected/arguments_objects/WithMultipleScalarArgsArgumentsObject.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ class WithMultipleScalarArgsArgumentsObject extends ArgumentsObject
1212
public function setScalarProperty($scalarProperty)
1313
{
1414
$this->scalarProperty = $scalarProperty;
15-
15+
1616
return $this;
1717
}
1818

1919
public function setAnotherScalarProperty($anotherScalarProperty)
2020
{
2121
$this->another_scalar_property = $anotherScalarProperty;
22-
22+
2323
return $this;
2424
}
2525
}

tests/files_expected/arguments_objects/WithScalarArgArgumentsObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class WithScalarArgArgumentsObject extends ArgumentsObject
1111
public function setScalarProperty($scalarProperty)
1212
{
1313
$this->scalarProperty = $scalarProperty;
14-
14+
1515
return $this;
1616
}
1717
}

tests/files_expected/input_objects/WithEnumValueInputObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class WithEnumValueInputObject extends InputObject
1111
public function setEnumVal($enumVal)
1212
{
1313
$this->enumVal = $enumVal;
14-
14+
1515
return $this;
1616
}
1717
}

tests/files_expected/input_objects/WithInputObjectValueInputObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class WithInputObjectValueInputObject extends InputObject
1111
public function setInputObject(WithListValueInputObject $withListValueInputObject)
1212
{
1313
$this->inputObject = $withListValueInputObject;
14-
14+
1515
return $this;
1616
}
1717
}

0 commit comments

Comments
 (0)