Skip to content
This repository was archived by the owner on Mar 12, 2024. It is now read-only.

Commit 41c0389

Browse files
committed
bypass assignment if the same name is already initialized
1 parent d99f4f5 commit 41c0389

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Traits/LoopFunctions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private function assignValue(string $key, mixed $value, mixed $rescue = null): v
6565
{
6666
if (property_exists($this, $key)) {
6767
rescue(
68-
fn () => $this->{$key} = $value,
68+
fn () => isset($this->{$key}) ?: $this->{$key} = $value,
6969
$rescue,
7070
config('loop-functions.log') ?? false
7171
);

0 commit comments

Comments
 (0)