Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ parameters:

ignoreErrors:
- "#Unsafe usage of new static\\(\\)#"
- "#Class Livewire\\\\Mechanisms\\\\ComponentRegistry not found#"
- "#Access to property \\$aliases on an unknown class Livewire\\\\Mechanisms\\\\ComponentRegistry#"
4 changes: 2 additions & 2 deletions src/FragmentAlias.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ class FragmentAlias
/**
* Encode the given fragment's component name and path into a base64 embedded alias.
*/
public static function encode(string $componentName, string $path, ?string $basePath = null): string
public static function encode(string $componentName, ?string $path, ?string $basePath = null): string
{
$basePath = $basePath ?? static::$basePath ?? base_path();

return 'volt-anonymous-fragment-'.base64_encode(json_encode([
'name' => $componentName,
'path' => str_replace($basePath.DIRECTORY_SEPARATOR, '', $path),
'path' => $path ? str_replace($basePath.DIRECTORY_SEPARATOR, '', $path) : '',
]));
}

Expand Down
2 changes: 2 additions & 0 deletions tests/Feature/ClassComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
beforeEach(function () {
View::setFinder(new FileViewFinder(app()['files'], [__DIR__.'/resources/views']));

View::addNamespace('layouts', __DIR__.'/resources/views/components/layouts');

Volt::mount([__DIR__.'/resources/views/class-api-pages', __DIR__.'/resources/views/class-api']);
});

Expand Down
2 changes: 2 additions & 0 deletions tests/Feature/FunctionalComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
beforeEach(function () {
View::setFinder(new FileViewFinder(app()['files'], [__DIR__.'/resources/views']));

View::addNamespace('layouts', __DIR__.'/resources/views/components/layouts');

Volt::mount([__DIR__.'/resources/views/functional-api-pages', __DIR__.'/resources/views/functional-api'], [GlobalTrait::class]);
});

Expand Down
Loading