Skip to content

Commit

Permalink
fix(php): native return types for AbstractModel methods (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3563

Co-authored-by: algolia-bot <[email protected]>
Co-authored-by: Aykut Ersoy <[email protected]>
Co-authored-by: Pierre Millot <[email protected]>
  • Loading branch information
3 people committed Aug 20, 2024
1 parent 1d085c1 commit 73a2545
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ abstract class AbstractModel
{
/**
* Gets the string presentation of the object.
*
* @return string
*/
public function __toString()
public function __toString(): string
{
return json_encode(
ObjectSerializer::sanitizeForSerialization($this),
Expand All @@ -32,17 +30,15 @@ public function __toString()
* @return mixed returns data which can be serialized by json_encode(), which is a value
* of any type other than a resource
*/
public function jsonSerialize()
public function jsonSerialize(): mixed
{
return ObjectSerializer::sanitizeForSerialization($this);
}

/**
* Gets a header-safe presentation of the object.
*
* @return string
*/
public function toHeaderValue()
public function toHeaderValue(): string
{
return json_encode(ObjectSerializer::sanitizeForSerialization($this));
}
Expand Down

0 comments on commit 73a2545

Please sign in to comment.