Skip to content

Commit 289fd17

Browse files
committed
Fix for indirect modification of overloaded property in keyboard
1 parent 1463c94 commit 289fd17

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Entities/Keyboard.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@ protected function createFromParams(): array
125125
public function addRow(): Keyboard
126126
{
127127
if (($new_row = $this->parseRow(func_get_args())) !== null) {
128-
$this->{$this->getKeyboardType()}[] = $new_row;
128+
// Workaround for "Indirect modification of overloaded property has no effect" notice in PHP 8.2.
129+
// https://stackoverflow.com/a/19749730/3757422
130+
$keyboard = $this->{$this->getKeyboardType()};
131+
$keyboard[] = $new_row;
132+
$this->{$this->getKeyboardType()} = $keyboard;
129133
}
130134

131135
return $this;

0 commit comments

Comments
 (0)