Skip to content

Commit

Permalink
Replace ternary expression with if/else block
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Jun 26, 2024
1 parent cc33174 commit c527e97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/framework/src/Support/Includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ public static function markdown(string $filename, ?string $default = null): ?Htm
$path = static::normalizePath($filename, '.md');

if (! Filesystem::exists($path)) {
return $default === null ? null : new HtmlString(trim(Markdown::render($default, MarkdownDocument::class)));
if ($default === null) {
return null;
} else {
return new HtmlString(trim(Markdown::render($default, MarkdownDocument::class)));
}
}

return new HtmlString(trim(Markdown::render(Filesystem::get($path), MarkdownDocument::class)));
Expand Down

0 comments on commit c527e97

Please sign in to comment.