From aa791d9a9a3e72db12b31483033ff6f44cdc40c0 Mon Sep 17 00:00:00 2001 From: "steven.lewis" Date: Thu, 11 Nov 2021 14:36:47 +0000 Subject: [PATCH 1/2] use #[\ReturnTypeWillChange] to suppress php 8.1 deprecations when a class implements ArrayAccess --- src/iTunes/PendingRenewalInfo.php | 4 ++++ src/iTunes/PurchaseItem.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/iTunes/PendingRenewalInfo.php b/src/iTunes/PendingRenewalInfo.php index 20b64db..ea9311a 100644 --- a/src/iTunes/PendingRenewalInfo.php +++ b/src/iTunes/PendingRenewalInfo.php @@ -281,6 +281,7 @@ public function isInGracePeriod(): bool * * @throws RunTimeException */ + #[ReturnTypeWillChange] public function offsetSet($key, $value) { $this->raw_data[$key] = $value; @@ -294,6 +295,7 @@ public function offsetSet($key, $value) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($key) { return $this->raw_data[$key]; @@ -304,6 +306,7 @@ public function offsetGet($key) * * @param $key */ + #[ReturnTypeWillChange] public function offsetUnset($key) { unset($this->raw_data[$key]); @@ -316,6 +319,7 @@ public function offsetUnset($key) * * @return bool */ + #[ReturnTypeWillChange] public function offsetExists($key): bool { return isset($this->raw_data[$key]); diff --git a/src/iTunes/PurchaseItem.php b/src/iTunes/PurchaseItem.php index 2c77a0b..2581bbc 100644 --- a/src/iTunes/PurchaseItem.php +++ b/src/iTunes/PurchaseItem.php @@ -301,6 +301,7 @@ public function getCancellationDate(): ?Carbon * * @throws RunTimeException */ + #[ReturnTypeWillChange] public function offsetSet($key, $value) { $this->raw_data[$key] = $value; @@ -314,6 +315,7 @@ public function offsetSet($key, $value) * * @return mixed */ + #[ReturnTypeWillChange] public function offsetGet($key) { return $this->raw_data[$key]; @@ -324,6 +326,7 @@ public function offsetGet($key) * * @param $key */ + #[ReturnTypeWillChange] public function offsetUnset($key) { unset($this->raw_data[$key]); @@ -336,6 +339,7 @@ public function offsetUnset($key) * * @return bool */ + #[ReturnTypeWillChange] public function offsetExists($key) { return isset($this->raw_data[$key]); From 77f533b11e6cd5aa0d344a3fb568623f2aea124a Mon Sep 17 00:00:00 2001 From: "steven.lewis" Date: Thu, 11 Nov 2021 14:47:51 +0000 Subject: [PATCH 2/2] use #[\ReturnTypeWillChange] to suppress php 8.1 deprecations when a class implements ArrayAccess --- src/iTunes/PendingRenewalInfo.php | 8 ++++---- src/iTunes/PurchaseItem.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/iTunes/PendingRenewalInfo.php b/src/iTunes/PendingRenewalInfo.php index ea9311a..75a327c 100644 --- a/src/iTunes/PendingRenewalInfo.php +++ b/src/iTunes/PendingRenewalInfo.php @@ -281,7 +281,7 @@ public function isInGracePeriod(): bool * * @throws RunTimeException */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($key, $value) { $this->raw_data[$key] = $value; @@ -295,7 +295,7 @@ public function offsetSet($key, $value) * * @return mixed */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($key) { return $this->raw_data[$key]; @@ -306,7 +306,7 @@ public function offsetGet($key) * * @param $key */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($key) { unset($this->raw_data[$key]); @@ -319,7 +319,7 @@ public function offsetUnset($key) * * @return bool */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($key): bool { return isset($this->raw_data[$key]); diff --git a/src/iTunes/PurchaseItem.php b/src/iTunes/PurchaseItem.php index 2581bbc..e735576 100644 --- a/src/iTunes/PurchaseItem.php +++ b/src/iTunes/PurchaseItem.php @@ -301,7 +301,7 @@ public function getCancellationDate(): ?Carbon * * @throws RunTimeException */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetSet($key, $value) { $this->raw_data[$key] = $value; @@ -315,7 +315,7 @@ public function offsetSet($key, $value) * * @return mixed */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetGet($key) { return $this->raw_data[$key]; @@ -326,7 +326,7 @@ public function offsetGet($key) * * @param $key */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetUnset($key) { unset($this->raw_data[$key]); @@ -339,7 +339,7 @@ public function offsetUnset($key) * * @return bool */ - #[ReturnTypeWillChange] + #[\ReturnTypeWillChange] public function offsetExists($key) { return isset($this->raw_data[$key]);