Fix TypeError in LCSCProvider when keyword is numeric string

PHP auto-casts numeric string array keys to int. When a search keyword
is a pure number (e.g., a part number like "12345"), the foreach loop
passes an int to processSearchResponse() which expects string. Cast
keyword to string explicitly.
This commit is contained in:
Sebastian Almberg 2026-03-12 10:40:28 +01:00
parent e70aa0ea19
commit 8e66f32ddc

View file

@ -396,6 +396,7 @@ class LCSCProvider implements BatchInfoProviderInterface, URLHandlerInfoProvider
// Now collect all results (like .then() in JavaScript)
foreach ($responses as $keyword => $response) {
try {
$keyword = (string) $keyword;
$arr = $response->toArray(); // This waits for the response
$results[$keyword] = $this->processSearchResponse($arr, $keyword);
} catch (\Exception $e) {