Skip to content

Commit 7cb6dfd

Browse files
authored
Changed default to prevent a null TypeError
1 parent fb5e144 commit 7cb6dfd

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/support/src/Assets/Asset.php

+4-8
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ abstract class Asset
1313

1414
protected string $package;
1515

16-
protected ?string $path = null;
16+
protected string $path = null;
1717

18-
final public function __construct(string $id, ?string $path = null)
18+
final public function __construct(string $id, ?string $path = '/')
1919
{
2020
$this->id = $id;
2121
$this->path = $path;
2222
}
2323

24-
public static function make(string $id, ?string $path = null): static
24+
public static function make(string $id, ?string $path = '/'): static
2525
{
2626
return app(static::class, ['id' => $id, 'path' => $path]);
2727
}
@@ -50,17 +50,13 @@ public function getPackage(): string
5050
return $this->package;
5151
}
5252

53-
public function getPath(): ?string
53+
public function getPath(): string
5454
{
5555
return $this->path;
5656
}
5757

5858
public function isRemote(): bool
5959
{
60-
if ($this->getPath() === null) {
61-
return false;
62-
}
63-
6460
return str($this->getPath())->startsWith(['http://', 'https://', '//']);
6561
}
6662

0 commit comments

Comments
 (0)