The getParameter method in Container.php can return a variety of types (array|bool|string|int|float|\UnitEnum|null). However, RequestBuilder->setHttpHeader() only accepts string values, which causes a PHPStan error in our tests when
@throws ParameterNotFoundException if the parameter is not defined
*/
public function getParameter(string $name): array|bool|string|int|float|\UnitEnum|null
{
return $this->parameterBag->get($name);
}
To handle this, we've implemented a solution (on our side):
The getParameter method in Container.php can return a variety of types (array|bool|string|int|float|\UnitEnum|null). However, RequestBuilder->setHttpHeader() only accepts string values, which causes a PHPStan error in our tests when
we retrieve:
and pass it to:
->setHttpHeader([ApiParams::API_KEY_HEADER,self::getContainer()->getParameter('xxx_api_key')])
because:
To handle this, we've implemented a solution (on our side):