diff --git a/src/Picqer/Carriers/SendCloud/Connection.php b/src/Picqer/Carriers/SendCloud/Connection.php index 594c45f..ca60fa4 100644 --- a/src/Picqer/Carriers/SendCloud/Connection.php +++ b/src/Picqer/Carriers/SendCloud/Connection.php @@ -12,10 +12,10 @@ class Connection private string $apiUrl = 'https://panel.sendcloud.sc/api/v2/'; private string $apiKey; private string $apiSecret; - private ?string $partnerId; - private ?int $maxResponseSizeInBytes; + private ?string $partnerId = null; + private ?int $maxResponseSizeInBytes = null; - private Client $client; + private ?Client $client = null; protected array $middleWares = []; public function __construct(string $apiKey, string $apiSecret, ?string $partnerId = null) @@ -27,7 +27,7 @@ public function __construct(string $apiKey, string $apiSecret, ?string $partnerI public function client(): Client { - if ($this->client) { + if ($this->client instanceof Client) { return $this->client; } @@ -182,6 +182,11 @@ public function setMaxResponseSizeInBytes(?int $maxResponseSizeInBytes): void $this->maxResponseSizeInBytes = $maxResponseSizeInBytes; } + public function getMaxResponseSizeInBytes(): ?int + { + return $this->maxResponseSizeInBytes; + } + public function download($url, array $headers = ['Accept' => 'application/pdf']): string { try {