Skip to content

Commit 7f18ad4

Browse files
add void return type declarations
1 parent e04ac05 commit 7f18ad4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Rates.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Ibericode\Vat;
66

7-
use DateTime;
87
use DateTimeInterface;
98
use DateTimeImmutable;
109
use Ibericode\Vat\Clients\ClientException;
@@ -46,13 +45,13 @@ public function __construct(string $storagePath, int $refreshInterval = 12 * 360
4645
$this->client = $client;
4746
}
4847

49-
private function load()
48+
private function load(): void
5049
{
5150
if (count($this->rates) > 0) {
5251
return;
5352
}
5453

55-
if ($this->storagePath !== '' && file_exists($this->storagePath)) {
54+
if ($this->storagePath !== '' && \is_file($this->storagePath)) {
5655
$this->loadFromFile();
5756

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

68-
private function loadFromFile()
67+
private function loadFromFile(): void
6968
{
7069
$contents = file_get_contents($this->storagePath);
7170
$data = unserialize($contents, [
@@ -82,7 +81,7 @@ private function loadFromFile()
8281
$this->rates = $data;
8382
}
8483

85-
private function loadFromRemote()
84+
private function loadFromRemote(): void
8685
{
8786
try {
8887
$this->client = $this->client ?: new IbericodeVatRatesClient();

0 commit comments

Comments
 (0)