$context =
$options[self::APP_REQUEST_CONTEXT
];
if (!
($context instanceof Context
)) { throw new InvalidArgumentException('app_request_context must be instance of Context'
);
} $request =
$this->
getLanguageHeaderRequest($request,
$context);
} if ($request->
hasHeader('sw-version'
)) { return clone $request;
} return $request->
withAddedHeader('sw-version',
$this->shopwareVersion
);
} private function getLanguageHeaderRequest(RequestInterface
$request, Context
$context): RequestInterface
{ $request =
$request->
withAddedHeader(self::SHOPWARE_CONTEXT_LANGUAGE,
$context->
getLanguageId());
return $request->
withAddedHeader(self::SHOPWARE_USER_LANGUAGE,
$this->localeProvider->
getLocaleFromContext($context));
}}