Skip to content

Commit

Permalink
Merge branch 'php-8.1-compatibility' into 'master'
Browse files Browse the repository at this point in the history
Php8.1 resolve json serializable return datatype deprecation

See merge request transip/restapi-php-library!162
  • Loading branch information
samihsoylu committed Jan 4, 2022
2 parents 5d42430 + 2c36e1e commit 4f5d5dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=========

6.12.1
-----
* Fixed a json serializable return datatype deprecation that occurred when running on PHP 8.1

6.12.0
-----
* Added OpenStack resource
Expand Down
12 changes: 9 additions & 3 deletions src/Entity/AbstractEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

namespace Transip\Api\Library\Entity;

use JsonSerializable;

class AbstractEntity implements JsonSerializable
class AbstractEntity implements \JsonSerializable
{
public function __construct(array $valueArray = [])
{
Expand All @@ -15,6 +13,14 @@ public function __construct(array $valueArray = [])
}
}

/**
* This method returns data that can be serialized by json_encode()
* natively.
*
* @return mixed
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return get_object_vars($this);
Expand Down
2 changes: 1 addition & 1 deletion src/TransipAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
class TransipAPI
{
public const TRANSIP_API_ENDPOINT = "https://api.transip.nl/v6";
public const TRANSIP_API_LIBRARY_VERSION = "6.12.0";
public const TRANSIP_API_LIBRARY_VERSION = "6.12.1";
public const TRANSIP_API_DEMO_TOKEN = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImN3MiFSbDU2eDNoUnkjelM4YmdOIn0.eyJpc3MiOiJhcGkudHJhbnNpcC5ubCIsImF1ZCI6ImFwaS50cmFuc2lwLm5sIiwianRpIjoiY3cyIVJsNTZ4M2hSeSN6UzhiZ04iLCJpYXQiOjE1ODIyMDE1NTAsIm5iZiI6MTU4MjIwMTU1MCwiZXhwIjoyMTE4NzQ1NTUwLCJjaWQiOiI2MDQ0OSIsInJvIjpmYWxzZSwiZ2siOmZhbHNlLCJrdiI6dHJ1ZX0.fYBWV4O5WPXxGuWG-vcrFWqmRHBm9yp0PHiYh_oAWxWxCaZX2Rf6WJfc13AxEeZ67-lY0TA2kSaOCp0PggBb_MGj73t4cH8gdwDJzANVxkiPL1Saqiw2NgZ3IHASJnisUWNnZp8HnrhLLe5ficvb1D9WOUOItmFC2ZgfGObNhlL2y-AMNLT4X7oNgrNTGm-mespo0jD_qH9dK5_evSzS3K8o03gu6p19jxfsnIh8TIVRvNdluYC2wo4qDl5EW5BEZ8OSuJ121ncOT1oRpzXB0cVZ9e5_UVAEr9X3f26_Eomg52-PjrgcRJ_jPIUYbrlo06KjjX2h0fzMr21ZE023Gw";

/**
Expand Down

0 comments on commit 4f5d5dd

Please sign in to comment.