From d9e850f980ef49ca8001ab20c556f77b4ff782b8 Mon Sep 17 00:00:00 2001 From: webeweb Date: Mon, 2 Jan 2023 15:11:20 +0100 Subject: [PATCH] Improve code quality --- src/Response/DocumentTelechargementResponse.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Response/DocumentTelechargementResponse.php b/src/Response/DocumentTelechargementResponse.php index 160ab18..9828df7 100644 --- a/src/Response/DocumentTelechargementResponse.php +++ b/src/Response/DocumentTelechargementResponse.php @@ -11,8 +11,7 @@ namespace WBW\Library\Pappers\Response; -use Exception; -use Throwable; +use RuntimeException; /** * Document téléchargementResponse. @@ -34,13 +33,13 @@ public function __construct() { * * @param string $filename The filename. * @return int Returns the number of bytes written. - * @throws Throwable Throws an exception if an error occurs. + * @throws RuntimeException Throws a runtime exception if an error occurs. */ public function saveAs(string $filename): int { $result = file_put_contents($filename, $this->getRawResponse()); if (false === $result) { - throw new Exception("An I/O error occurs"); + throw new RuntimeException("An I/O error occurs"); } return $result;