Skip to content

Commit 449a7ac

Browse files
authored
fix: mergeIfMissing function: (#198)
2 parents 0e74f1b + 84332d2 commit 449a7ac

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/Phaseolies/Http/Request.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ public function all(): ?array
599599
public function merge(array $input): self
600600
{
601601
$this->request->replace(array_merge($this->request->all(), $input));
602+
$this->input = [];
602603

603604
return $this;
604605
}

src/Phaseolies/Http/Support/RequestHelper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ public function nullifyBlanks(
244244
});
245245

246246
$this->request->replace($data);
247+
$this->input = [];
247248

248249
return $this;
249250
}

src/Phaseolies/Support/Router.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ protected function matchesDomain(string $domain, $request): bool
832832
$existing = $request->getRouteParams();
833833
$existing[$m[1]] = $hostMatch[1];
834834
$request->setRouteParams($existing);
835-
$request->merge([$m[1] => $hostMatch[1]]);
835+
$request->mergeIfMissing([$m[1] => $hostMatch[1]]);
836836

837837
return true;
838838
}

0 commit comments

Comments
 (0)