Skip to content

Commit

Permalink
Fix for indirect modification of overloaded property in keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
noplanman committed May 27, 2023
1 parent 1463c94 commit 289fd17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Entities/Keyboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ protected function createFromParams(): array
public function addRow(): Keyboard
{
if (($new_row = $this->parseRow(func_get_args())) !== null) {
$this->{$this->getKeyboardType()}[] = $new_row;
// Workaround for "Indirect modification of overloaded property has no effect" notice in PHP 8.2.
// https://stackoverflow.com/a/19749730/3757422
$keyboard = $this->{$this->getKeyboardType()};
$keyboard[] = $new_row;
$this->{$this->getKeyboardType()} = $keyboard;
}

return $this;
Expand Down

0 comments on commit 289fd17

Please sign in to comment.