Skip to content

Commit

Permalink
Introduce local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jun 24, 2024
1 parent c2f0faa commit 24532a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/framework/src/Support/DataCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down

0 comments on commit 24532a1

Please sign in to comment.