Skip to content

Commit

Permalink
Make setter fluent. (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
fattouchsquall authored and saimaz committed Apr 13, 2017
1 parent aa75c61 commit c3c53f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Generator/DocumentGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ public function is<methodName>()
* Sets <fieldName>
*
* @param string $<fieldName>
*
* @return self
*/
public function set<methodName>($<fieldName>)
{
<spaces>$this-><fieldName> = $<fieldName>;
<spaces>return $this;
}';

/**
Expand Down Expand Up @@ -160,7 +164,7 @@ private function generateDocumentMethods(array $metadata)
if (isset($property['property_type']) && $property['property_type'] === 'boolean') {
$lines[] = $this->generateDocumentMethod($property, $this->isMethodTemplate) . "\n";
}

$lines[] = $this->generateDocumentMethod($property, $this->getMethodTemplate) . "\n";
}

Expand Down

0 comments on commit c3c53f1

Please sign in to comment.