Skip to content

Commit

Permalink
Return static from fluid setters (#236)
Browse files Browse the repository at this point in the history
* Return static from fluid setters

Signed-off-by: Kim Pepper <kim@pepper.id.au>

* Revert generated code

Signed-off-by: Kim Pepper <kim@pepper.id.au>

* Update CHANGELOG.md

Signed-off-by: Shyim <github@shyim.de>

---------

Signed-off-by: Kim Pepper <kim@pepper.id.au>
Signed-off-by: Shyim <github@shyim.de>
Co-authored-by: Shyim <github@shyim.de>
  • Loading branch information
kimpepper and shyim authored Nov 5, 2024
1 parent d4e4d6d commit add2d03
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions util/template/set-bulk-body
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

public function setBody($body): :endpoint
public function setBody($body): static
{
if (isset($body) !== true) {
return $this;
Expand All @@ -17,4 +17,4 @@
throw new InvalidArgumentException("Body must be an array, traversable object or string");
}
return $this;
}
}
2 changes: 1 addition & 1 deletion util/template/set-part
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

public function set:Part($:part): :endpoint
public function set:Part($:part): static
{
if (isset($:part) !== true) {
return $this;
Expand Down
2 changes: 1 addition & 1 deletion util/template/set-part-list
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

public function set:Part($:part): :endpoint
public function set:Part($:part): static
{
if (isset($:part) !== true) {
return $this;
Expand Down

0 comments on commit add2d03

Please sign in to comment.