DX: fix phpstan errors

This commit is contained in:
2023-02-04 00:50:58 +01:00
parent a01cc23c14
commit 856eea37ee
16 changed files with 94 additions and 120 deletions

View File

@@ -69,7 +69,6 @@ class Convert
$content = $this->storedObjectManager->read($storedObject);
try {
$url = sprintf('%s/cool/convert-to/pdf', $this->collaboraDomain);
$form = new FormDataPart([
'data' => new DataPart($content, $storedObject->getUuid()->toString(), $storedObject->getType()),
@@ -80,16 +79,11 @@ class Convert
'timeout' => 10,
]);
try {
return new Response($response->getContent(), Response::HTTP_OK, [
'Content-Type' => 'application/pdf',
]);
} catch (ClientExceptionInterface $exception) {
return $this->onConversionFailed($url, $response);
} catch (RedirectionExceptionInterface $e) {
return $this->onConversionFailed($url, $response);
} catch (ServerExceptionInterface $e) {
return $this->onConversionFailed($url, $response);
} catch (TransportExceptionInterface $e) {
} catch (ClientExceptionInterface|TransportExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface $exception) {
return $this->onConversionFailed($url, $response);
}
}

View File

@@ -32,7 +32,7 @@ class UserManager implements \ChampsLibres\WopiBundle\Contracts\UserManagerInter
return null;
}
return (string) $user->getLabel();
return $user->getLabel();
}
public function getUserId(string $accessToken, string $fileId, RequestInterface $request): ?string