From 4fab47178d1171c6249516fa662f8bfb388044f9 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Fri, 26 Feb 2016 09:00:43 -0600 Subject: [PATCH] All FHIR class property setters are now fluent (suggested by @kchapple) --- .gitignore | 1 + src/ClassGenerator/Template/SetterMethodTemplate.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b4e297ba..fc979c26 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ composer.lock /class.Diff.php *.iml .idea/ +/.svn diff --git a/src/ClassGenerator/Template/SetterMethodTemplate.php b/src/ClassGenerator/Template/SetterMethodTemplate.php index 55e617d7..7555819b 100644 --- a/src/ClassGenerator/Template/SetterMethodTemplate.php +++ b/src/ClassGenerator/Template/SetterMethodTemplate.php @@ -77,7 +77,7 @@ public function compileTemplate() ); } - $output = sprintf("%s */\n %s function %s(", $output, (string)$this->getScope(), $this->getName()); + $output = sprintf("%s * @return \$this\n */\n %s function %s(", $output, (string)$this->getScope(), $this->getName()); $params = array(); foreach($this->getParameters() as $param) @@ -91,6 +91,6 @@ public function compileTemplate() $output = sprintf("%s %s\n", $output, $line); } - return sprintf("%s }\n\n", $output); + return sprintf("%s return \$this;\n }\n\n", $output); } } \ No newline at end of file