Skip to content

Commit

Permalink
Add ReturnTypeWillChange attribute (#2269)
Browse files Browse the repository at this point in the history
Adds ReturnTypeWillChange attribute in order to not break forward compatibility with php 8
  • Loading branch information
driesvints authored Aug 2, 2021
1 parent 037fd80 commit 2852f64
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Api/DateTimeResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Aws\Api\Parser\Exception\ParserException;
use Exception;
use \ReturnTypeWillChange;

/**
* DateTime overrides that make DateTime work more seamlessly as a string,
Expand Down Expand Up @@ -94,6 +95,7 @@ public function __toString()
*
* @return mixed|string
*/
#[ReturnTypeWillChange]
public function jsonSerialize()
{
return (string) $this;
Expand Down
2 changes: 2 additions & 0 deletions src/Crypto/MetadataEnvelope.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use \IteratorAggregate;
use \InvalidArgumentException;
use \JsonSerializable;
use \ReturnTypeWillChange;

/**
* Stores encryption metadata for reading and writing.
Expand Down Expand Up @@ -49,6 +50,7 @@ public function offsetSet($name, $value)
$this->data[$name] = $value;
}

#[ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->data;
Expand Down
2 changes: 2 additions & 0 deletions src/DynamoDb/BinaryValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
namespace Aws\DynamoDb;

use GuzzleHttp\Psr7;
use \ReturnTypeWillChange;

/**
* Special object to represent a DynamoDB binary (B) value.
Expand All @@ -24,6 +25,7 @@ public function __construct($value)
$this->value = (string) $value;
}

#[ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->value;
Expand Down
3 changes: 3 additions & 0 deletions src/DynamoDb/NumberValue.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace Aws\DynamoDb;

use \ReturnTypeWillChange;

/**
* Special object to represent a DynamoDB Number (N) value.
*/
Expand All @@ -17,6 +19,7 @@ public function __construct($value)
$this->value = (string) $value;
}

#[ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->value;
Expand Down
8 changes: 8 additions & 0 deletions src/DynamoDb/SessionHandler.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace Aws\DynamoDb;

use \ReturnTypeWillChange;

/**
* Provides an interface for using Amazon DynamoDB as a session store by hooking
* into PHP's session handler hooks. Once registered, You may use the native
Expand Down Expand Up @@ -101,6 +103,7 @@ public function register()
*
* @return bool Whether or not the operation succeeded.
*/
#[ReturnTypeWillChange]
public function open($savePath, $sessionName)
{
$this->savePath = $savePath;
Expand All @@ -114,6 +117,7 @@ public function open($savePath, $sessionName)
*
* @return bool Success
*/
#[ReturnTypeWillChange]
public function close()
{
$id = session_id();
Expand All @@ -134,6 +138,7 @@ public function close()
*
* @return string Session data.
*/
#[ReturnTypeWillChange]
public function read($id)
{
$this->openSessionId = $id;
Expand Down Expand Up @@ -167,6 +172,7 @@ public function read($id)
*
* @return bool Whether or not the operation succeeded.
*/
#[ReturnTypeWillChange]
public function write($id, $data)
{
$changed = $id !== $this->openSessionId
Expand All @@ -187,6 +193,7 @@ public function write($id, $data)
*
* @return bool Whether or not the operation succeeded.
*/
#[ReturnTypeWillChange]
public function destroy($id)
{
$this->openSessionId = $id;
Expand All @@ -206,6 +213,7 @@ public function destroy($id)
* @return bool Whether or not the operation succeeded.
* @codeCoverageIgnore
*/
#[ReturnTypeWillChange]
public function gc($maxLifetime)
{
// Garbage collection for a DynamoDB table must be triggered manually.
Expand Down
3 changes: 3 additions & 0 deletions src/DynamoDb/SetValue.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
namespace Aws\DynamoDb;

use \ReturnTypeWillChange;

/**
* Special object to represent a DynamoDB set (SS/NS/BS) value.
*/
Expand Down Expand Up @@ -37,6 +39,7 @@ public function getIterator()
return new \ArrayIterator($this->values);
}

#[ReturnTypeWillChange]
public function jsonSerialize()
{
return $this->toArray();
Expand Down

0 comments on commit 2852f64

Please sign in to comment.