Skip to content

Commit

Permalink
🩹 Prevent with() and override() from being triggered twice on mer…
Browse files Browse the repository at this point in the history
…ge (#350)
  • Loading branch information
folbert authored Feb 17, 2024
1 parent d049493 commit 35e7ac7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Roots/Acorn/View/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ public function compose(View $view)
*/
protected function merge()
{
if (! $this->with() && ! $this->override()) {
[$with, $override] = [$this->with(), $this->override()];

if (! $with && ! $override) {
return array_merge(
$this->extractPublicProperties(),
$this->extractPublicMethods(),
Expand All @@ -99,9 +101,9 @@ protected function merge()
}

return array_merge(
$this->with(),
$with,
$this->view->getData(),
$this->override()
$override
);
}

Expand Down

0 comments on commit 35e7ac7

Please sign in to comment.