Skip to content

Commit c5aded5

Browse files
fix php8.1 jsonserialize
1 parent b1235d3 commit c5aded5

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Model/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function addElement($element)
4343
/**
4444
* @return int
4545
*/
46-
public function count()
46+
public function count(): int
4747
{
4848
return count($this->elements);
4949
}
@@ -55,7 +55,7 @@ public function count()
5555
* which is a value of any type other than a resource.
5656
* @since 5.4.0
5757
*/
58-
public function jsonSerialize()
58+
public function jsonSerialize(): mixed
5959
{
6060
if ($this->key !== null) {
6161
return [$this->key => $this->elements];

src/Model/Customer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public function __toString(): string
235235
* which is a value of any type other than a resource.
236236
* @since 5.4.0
237237
*/
238-
function jsonSerialize()
238+
function jsonSerialize(): mixed
239239
{
240240
$data = [
241241
'email_address' => $this->emailAddress,

src/Model/Order.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public function addDetailsView(DetailsView $detailsView)
321321
* which is a value of any type other than a resource.
322322
* @since 5.4.0
323323
*/
324-
public function jsonSerialize()
324+
public function jsonSerialize(): mixed
325325
{
326326
$data = [
327327
'order_number' => $this->orderNumber,

src/Model/Order/DetailsView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function setDateFormat(string $dateFormat)
106106
* which is a value of any type other than a resource.
107107
* @since 5.4.0
108108
*/
109-
public function jsonSerialize()
109+
public function jsonSerialize(): mixed
110110
{
111111
$data = ['display_as' => $this->displayAs];
112112

src/Model/SearchResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct(Collection $customerCollection, Collection $orderCol
3939
* which is a value of any type other than a resource.
4040
* @since 5.4.0
4141
*/
42-
public function jsonSerialize()
42+
public function jsonSerialize(): mixed
4343
{
4444
return [
4545
'customers' => $this->customerCollection,

0 commit comments

Comments
 (0)