From add2d03b12a62ae4d0664553046769da608b062b Mon Sep 17 00:00:00 2001 From: Kim Pepper Date: Tue, 5 Nov 2024 20:10:16 +1100 Subject: [PATCH] Return static from fluid setters (#236) * Return static from fluid setters Signed-off-by: Kim Pepper * Revert generated code Signed-off-by: Kim Pepper * Update CHANGELOG.md Signed-off-by: Shyim --------- Signed-off-by: Kim Pepper Signed-off-by: Shyim Co-authored-by: Shyim --- CHANGELOG.md | 1 + util/template/set-bulk-body | 4 ++-- util/template/set-part | 2 +- util/template/set-part-list | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f425e5106..d143b19ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added support for PHP 8.3 and 8.4 ([#229](https://github.com/opensearch-project/opensearch-php/pull/229)) ### Changed - Increased min version of `ezimuel/ringphp` to `^1.2.2` +- Changed fluent setters to return static ### Deprecated ### Removed ### Fixed diff --git a/util/template/set-bulk-body b/util/template/set-bulk-body index bebb6700c..ece8963fc 100644 --- a/util/template/set-bulk-body +++ b/util/template/set-bulk-body @@ -1,5 +1,5 @@ - public function setBody($body): :endpoint + public function setBody($body): static { if (isset($body) !== true) { return $this; @@ -17,4 +17,4 @@ throw new InvalidArgumentException("Body must be an array, traversable object or string"); } return $this; - } \ No newline at end of file + } diff --git a/util/template/set-part b/util/template/set-part index 5397fed50..e84cc82ee 100644 --- a/util/template/set-part +++ b/util/template/set-part @@ -1,5 +1,5 @@ - public function set:Part($:part): :endpoint + public function set:Part($:part): static { if (isset($:part) !== true) { return $this; diff --git a/util/template/set-part-list b/util/template/set-part-list index 21fa13610..6f786de9a 100644 --- a/util/template/set-part-list +++ b/util/template/set-part-list @@ -1,5 +1,5 @@ - public function set:Part($:part): :endpoint + public function set:Part($:part): static { if (isset($:part) !== true) { return $this;