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); }); }