From e2d6566b56a0b0439c210d9f6ad075be45b1e6be Mon Sep 17 00:00:00 2001 From: fenguoz <243944672@qq.com> Date: Thu, 10 Oct 2024 09:41:20 +0800 Subject: [PATCH] Solve the default value problem of Transaction class in php8.1+ --- src/Transaction.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Transaction.php b/src/Transaction.php index f7dfefa..306e2fa 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -249,7 +249,7 @@ public function __toString() * @param string value * @return void */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { $txKey = isset($this->attributeMap[$offset]) ? $this->attributeMap[$offset] : null; @@ -289,7 +289,8 @@ public function offsetSet($offset, $value) * @param string $offset key, eg: to * @return bool */ - public function offsetExists($offset) + #[\ReturnTypeWillChange] + public function offsetExists($offset):bool { $txKey = isset($this->attributeMap[$offset]) ? $this->attributeMap[$offset] : null; @@ -305,7 +306,7 @@ public function offsetExists($offset) * @param string $offset key, eg: to * @return void */ - public function offsetUnset($offset) + public function offsetUnset($offset):void { $txKey = isset($this->attributeMap[$offset]) ? $this->attributeMap[$offset] : null; @@ -320,7 +321,7 @@ public function offsetUnset($offset) * @param string $offset key, eg: to * @return mixed value of the transaction */ - public function offsetGet($offset) + public function offsetGet($offset):mixed { $txKey = isset($this->attributeMap[$offset]) ? $this->attributeMap[$offset] : null;