Skip to content

Commit

Permalink
Shift absolute path qualification to calling method
Browse files Browse the repository at this point in the history
Also reduces unnecessary double qualification attempt in the get method
  • Loading branch information
caendesilva committed Jun 26, 2024
1 parent 76b35dc commit c77d1fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/framework/src/Support/Includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static function markdown(string $filename, ?string $default = null): ?Htm
protected static function getInclude(callable $method, string $extension, ?string $default, string $filename): ?HtmlString
{
$path = static::normalizePath($filename, $extension);
$contents = static::getFileContents($path);
$contents = static::getFileContents(static::path($path));

if ($contents === null && $default === null) {
return null;
Expand All @@ -112,11 +112,11 @@ protected static function normalizePath(string $filename, string $extension = ''

protected static function getFileContents(string $path): ?string
{
if (! Filesystem::exists(static::path($path))) {
if (! Filesystem::exists($path)) {
return null;
}

return Filesystem::get(static::path($path));
return Filesystem::get($path);
}

protected static function renderHtml(string $html): HtmlString
Expand Down

0 comments on commit c77d1fc

Please sign in to comment.