Skip to content

Commit

Permalink
add void return type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Nov 2, 2023
1 parent e04ac05 commit 7f18ad4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Rates.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Ibericode\Vat;

use DateTime;
use DateTimeInterface;
use DateTimeImmutable;
use Ibericode\Vat\Clients\ClientException;
Expand Down Expand Up @@ -46,13 +45,13 @@ public function __construct(string $storagePath, int $refreshInterval = 12 * 360
$this->client = $client;
}

private function load()
private function load(): void
{
if (count($this->rates) > 0) {
return;
}

if ($this->storagePath !== '' && file_exists($this->storagePath)) {
if ($this->storagePath !== '' && \is_file($this->storagePath)) {
$this->loadFromFile();

// bail early if file is still valid
Expand All @@ -65,7 +64,7 @@ private function load()
$this->loadFromRemote();
}

private function loadFromFile()
private function loadFromFile(): void
{
$contents = file_get_contents($this->storagePath);
$data = unserialize($contents, [
Expand All @@ -82,7 +81,7 @@ private function loadFromFile()
$this->rates = $data;
}

private function loadFromRemote()
private function loadFromRemote(): void
{
try {
$this->client = $this->client ?: new IbericodeVatRatesClient();
Expand Down

0 comments on commit 7f18ad4

Please sign in to comment.