Skip to content

Commit c3c53f1

Browse files
fattouchsquallsaimaz
authored andcommitted
Make setter fluent. (#783)
1 parent aa75c61 commit c3c53f1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Generator/DocumentGenerator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,14 @@ public function is<methodName>()
5959
* Sets <fieldName>
6060
*
6161
* @param string $<fieldName>
62+
*
63+
* @return self
6264
*/
6365
public function set<methodName>($<fieldName>)
6466
{
6567
<spaces>$this-><fieldName> = $<fieldName>;
68+
69+
<spaces>return $this;
6670
}';
6771

6872
/**
@@ -160,7 +164,7 @@ private function generateDocumentMethods(array $metadata)
160164
if (isset($property['property_type']) && $property['property_type'] === 'boolean') {
161165
$lines[] = $this->generateDocumentMethod($property, $this->isMethodTemplate) . "\n";
162166
}
163-
167+
164168
$lines[] = $this->generateDocumentMethod($property, $this->getMethodTemplate) . "\n";
165169
}
166170

0 commit comments

Comments
 (0)