Skip to content

Commit

Permalink
Support nullable return (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
Casperhr authored Apr 21, 2022
1 parent fc622b0 commit 6f12686
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Fractal.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public function toJson($options = 0)
/**
* Perform the transformation to array.
*
* @return array
* @return array|null
*/
public function toArray()
{
Expand Down Expand Up @@ -455,10 +455,10 @@ public function getResourceName()
/**
* Convert the object into something JSON serializable.
*
* @return array
* @return array|null
*/
#[\ReturnTypeWillChange]
public function jsonSerialize(): array
public function jsonSerialize(): ?array
{
return $this->toArray();
}
Expand Down

0 comments on commit 6f12686

Please sign in to comment.