From 24532a1f9fe01135ba84048d618c8992c0000c6b Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Mon, 24 Jun 2024 20:35:02 +0200 Subject: [PATCH] Introduce local variable --- packages/framework/src/Support/DataCollection.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/framework/src/Support/DataCollection.php b/packages/framework/src/Support/DataCollection.php index 8804b99f552..bc8f534e2e5 100644 --- a/packages/framework/src/Support/DataCollection.php +++ b/packages/framework/src/Support/DataCollection.php @@ -84,7 +84,9 @@ 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|null { - return json_decode(Filesystem::getContents($file), $asArray); + $contents = Filesystem::getContents($file); + + return json_decode($contents, $asArray); }); }