Skip to content

Commit

Permalink
Normalize control flow
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jun 26, 2024
1 parent 11a6015 commit 9a07581
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/framework/src/Support/Includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@ public static function path(?string $filename = null): string
public static function get(string $filename, ?string $default = null): ?string
{
$path = static::path(static::normalizePath($filename));
$contents = static::getFileContents($path);

if (! Filesystem::exists($path)) {
return $default;
if ($contents === null && $default === null) {
return null;
}

return static::getFileContents($path);
return $contents ?? $default;
}

/**
Expand Down

0 comments on commit 9a07581

Please sign in to comment.