Closed TiMESPLiNTER closed 3 years ago
Could you try to fix the pipeline. It seems like we are missing some typehints.
Could you try to fix the pipeline. It seems like we are missing some typehints.
Not so easy imo. For example this is a problem:
foreach ($request->request->get('items') as $item) {
$item['token'] = $token;
$commandRequests[] = $this->provideCommandRequest($item);
}
------ ----------------------------------------------------------------
Line Controller/Cart/PutItemsToCartAction.php
------ ----------------------------------------------------------------
75 Argument of an invalid type bool|float|int|string supplied for
foreach, only iterables are supported.
it's not about type hints but to properly fix it imo we would need to do something like this:
$items = $request->request->get('items');
if (false === is_iterable($items)) {
throw new BadRequestHttpException('items need to be an array');
}
foreach ($items as $item) {
$item['token'] = $token;
$commandRequests[] = $this->provideCommandRequest($item);
}
Yeah true that. Theoretically the api would currently also accept a string in that position.
With the current composer.json constraints regarding the Symfony packages we only are allowed to install version
5.2.0
of the packages. This PR fixes this and allows^5.2
to be installed.