Skip to content

Commit

Permalink
Improve code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Jan 2, 2023
1 parent 4810307 commit d9e850f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Response/DocumentTelechargementResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

namespace WBW\Library\Pappers\Response;

use Exception;
use Throwable;
use RuntimeException;

/**
* Document téléchargementResponse.
Expand All @@ -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;
Expand Down

0 comments on commit d9e850f

Please sign in to comment.