From a80b3d41993d3e97c458005265fd140bbe288dae Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 24 Jun 2024 19:25:58 +0200 Subject: [PATCH] Add null return type support pending https://github.com/hydephp/develop/issues/1736 --- packages/framework/src/Support/DataCollection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/src/Support/DataCollection.php b/packages/framework/src/Support/DataCollection.php index 7185e45e16c..ea1ccb468d2 100644 --- a/packages/framework/src/Support/DataCollection.php +++ b/packages/framework/src/Support/DataCollection.php @@ -84,7 +84,7 @@ public static function yaml(string $name): static */ public static function json(string $name, bool $asArray = false): static { - return static::discover($name, 'json', function (string $file) use ($asArray): stdClass|array { + return static::discover($name, 'json', function (string $file) use ($asArray): stdClass|array|null { return json_decode(Filesystem::getContents($file), $asArray); }); }