From d43011a420adef1156068d6b7080ef659283ecef Mon Sep 17 00:00:00 2001 From: Dean McPherson Date: Wed, 22 May 2024 14:38:37 +1000 Subject: [PATCH 1/4] Update Component.php No finals! --- src/Component.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Component.php b/src/Component.php index 9b6acb2..b68cbea 100644 --- a/src/Component.php +++ b/src/Component.php @@ -36,7 +36,7 @@ public function __construct() /** * Render the component. */ - final public function render(): mixed + public function render(): mixed { $alias = $this->getAlias(); From 99ced04b7089543422b54ffd3437f9978eb16f13 Mon Sep 17 00:00:00 2001 From: Dean McPherson Date: Wed, 22 May 2024 14:58:17 +1000 Subject: [PATCH 2/4] Update VoltServiceProvider.php Ditch phpstan ignores --- src/VoltServiceProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VoltServiceProvider.php b/src/VoltServiceProvider.php index 0dee422..515b743 100644 --- a/src/VoltServiceProvider.php +++ b/src/VoltServiceProvider.php @@ -116,7 +116,7 @@ protected function registerTestingMacros(): void $component = FragmentMap::get($component); } - return $this->assertSeeLivewire($component); // @phpstan-ignore-line + return $this->assertSeeLivewire($component); }); TestResponse::macro('assertDontSeeVolt', function ($component) { @@ -126,7 +126,7 @@ protected function registerTestingMacros(): void $component = FragmentMap::get($component); } - return $this->assertDontSeeLivewire($component); // @phpstan-ignore-line + return $this->assertDontSeeLivewire($component); }); } } From 2a6fb62fe356bbd123c71ad5215437e6d730017d Mon Sep 17 00:00:00 2001 From: Dean McPherson Date: Wed, 22 May 2024 16:47:34 +1000 Subject: [PATCH 3/4] Update ComponentFactory.php allow variables to be preserved if manually added --- src/ComponentFactory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ComponentFactory.php b/src/ComponentFactory.php index 4b9a859..b10821e 100644 --- a/src/ComponentFactory.php +++ b/src/ComponentFactory.php @@ -70,7 +70,7 @@ protected function requirePath(string $path): void $__path = $path; - CompileContext::instance()->variables = (static function () use ($__path) { + $variables = (static function () use ($__path) { require $__path; return array_map(function (mixed $variable) { @@ -79,9 +79,11 @@ protected function requirePath(string $path): void : $variable; }, get_defined_vars()); })(); + CompileContext::instance()->variables = array_merge(CompileContext::instance()->variables, $variables); } finally { ob_get_clean(); } + } /** From b1e3c77609e2ce23f06cf8112590225b7804d21c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 23 May 2024 13:41:47 -0500 Subject: [PATCH 4/4] Update ComponentFactory.php --- src/ComponentFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ComponentFactory.php b/src/ComponentFactory.php index b10821e..e2abcb6 100644 --- a/src/ComponentFactory.php +++ b/src/ComponentFactory.php @@ -79,11 +79,11 @@ protected function requirePath(string $path): void : $variable; }, get_defined_vars()); })(); + CompileContext::instance()->variables = array_merge(CompileContext::instance()->variables, $variables); } finally { ob_get_clean(); } - } /**