File tree 1 file changed +4
-5
lines changed 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace Ibericode \Vat ;
6
6
7
- use DateTime ;
8
7
use DateTimeInterface ;
9
8
use DateTimeImmutable ;
10
9
use Ibericode \Vat \Clients \ClientException ;
@@ -46,13 +45,13 @@ public function __construct(string $storagePath, int $refreshInterval = 12 * 360
46
45
$ this ->client = $ client ;
47
46
}
48
47
49
- private function load ()
48
+ private function load (): void
50
49
{
51
50
if (count ($ this ->rates ) > 0 ) {
52
51
return ;
53
52
}
54
53
55
- if ($ this ->storagePath !== '' && file_exists ($ this ->storagePath )) {
54
+ if ($ this ->storagePath !== '' && \is_file ($ this ->storagePath )) {
56
55
$ this ->loadFromFile ();
57
56
58
57
// bail early if file is still valid
@@ -65,7 +64,7 @@ private function load()
65
64
$ this ->loadFromRemote ();
66
65
}
67
66
68
- private function loadFromFile ()
67
+ private function loadFromFile (): void
69
68
{
70
69
$ contents = file_get_contents ($ this ->storagePath );
71
70
$ data = unserialize ($ contents , [
@@ -82,7 +81,7 @@ private function loadFromFile()
82
81
$ this ->rates = $ data ;
83
82
}
84
83
85
- private function loadFromRemote ()
84
+ private function loadFromRemote (): void
86
85
{
87
86
try {
88
87
$ this ->client = $ this ->client ?: new IbericodeVatRatesClient ();
You can’t perform that action at this time.
0 commit comments