Skip to content

Commit 4552c27

Browse files
committed
fix(app): Fixing a Psalm issue with transform method
1 parent af3f2a8 commit 4552c27

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

system/API/BaseTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ abstract public function toArray(mixed $resource): array;
9595
* Transforms the given resource into an array using
9696
* the $this->toArray().
9797
*/
98-
public function transform(mixed $resource = null): array
98+
public function transform(array|object|null $resource = null): array
9999
{
100100
// Store the resource so include methods can access it
101101
$this->resource = $resource;

system/API/TransformerInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public function toArray(mixed $resource): array;
3434
/**
3535
* Transforms the given resource into an array.
3636
*
37-
* @param array<string, mixed>|object $resource
37+
* @param array<string, mixed>|object|null $resource
3838
*
3939
* @return array<string, mixed>
4040
*/
41-
public function transform(array|object $resource): array;
41+
public function transform(array|object|null $resource): array;
4242

4343
/**
4444
* Transforms a collection of resources using $this->transform() on each item.

0 commit comments

Comments
 (0)