We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38a7b9d commit 44d681bCopy full SHA for 44d681b
src/Entities/Keyboard.php
@@ -88,12 +88,6 @@ protected function createFromParams(): array
88
89
$data = reset($args);
90
91
- // reset() returns false, if the array was empty,
92
- // which crashes force-casting $data into an array
93
- if ($data === false) {
94
- return [];
95
- }
96
-
97
if ($from_data = array_key_exists($keyboard_type, (array) $data)) {
98
$args = $data[$keyboard_type];
99
@@ -115,7 +109,8 @@ protected function createFromParams(): array
115
109
$data[$keyboard_type] = $new_keyboard;
116
110
}
117
111
118
- return $data;
112
+ // If $args was empty, $data still contains `false`
113
+ return $data ?? [];
119
114
120
121
/**
0 commit comments