@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | class Cache implements ICache |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | - private const FILE_SCHEME = Utils\SafeStream::PROTOCOL . '://'; |
|
| 13 | + private const FILE_SCHEME = Utils\SafeStream::PROTOCOL.'://'; |
|
| 14 | 14 | private const FILE_CURRENT = 'current'; |
| 15 | 15 | |
| 16 | 16 | /** @var string */ |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | $listRates = $driver->download($date, $this->allowedCurrencies); |
| 89 | 89 | |
| 90 | - file_put_contents(self::FILE_SCHEME . $file->getPathname(), serialization($listRates)); |
|
| 90 | + file_put_contents(self::FILE_SCHEME.$file->getPathname(), serialization($listRates)); |
|
| 91 | 91 | if (self::isFileCurrent($file)) { |
| 92 | 92 | touch($file->getPathname(), $this->getRefresh()); |
| 93 | 93 | } |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | if ($this->isFileValid($file)) { |
| 102 | 102 | Utils\FileSystem::createDir($file->getPath(), 0755); |
| 103 | - $lockFile = $this->temp . DIRECTORY_SEPARATOR . 'lock'; |
|
| 104 | - $handle = fopen(self::FILE_SCHEME . $lockFile, 'w'); |
|
| 103 | + $lockFile = $this->temp.DIRECTORY_SEPARATOR.'lock'; |
|
| 104 | + $handle = fopen(self::FILE_SCHEME.$lockFile, 'w'); |
|
| 105 | 105 | |
| 106 | 106 | if ($handle === false) { |
| 107 | - throw new InvalidState('Could not write to lock file. ' . $lockFile); |
|
| 107 | + throw new InvalidState('Could not write to lock file. '.$lockFile); |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | if ($this->isFileValid($file)) { |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | private function getRefresh(): int |
| 133 | 133 | { |
| 134 | 134 | if (!is_int($this->refresh)) { |
| 135 | - $this->refresh = (int) (new \DateTime('today ' . $this->refresh))->format('U'); |
|
| 135 | + $this->refresh = (int) (new \DateTime('today '.$this->refresh))->format('U'); |
|
| 136 | 136 | if (time() >= $this->refresh) { |
| 137 | 137 | $this->refresh += Utils\DateTime::DAY; |
| 138 | 138 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | private function createFileInfo(Driver\Driver $driver, ?\DateTimeInterface $date): \SplFileInfo |
| 145 | 145 | { |
| 146 | 146 | $filename = $date === null ? self::FILE_CURRENT : $date->format('Y-m-d'); |
| 147 | - return new \SplFileInfo($this->temp . DIRECTORY_SEPARATOR . $driver->getName() . DIRECTORY_SEPARATOR . $filename); |
|
| 147 | + return new \SplFileInfo($this->temp.DIRECTORY_SEPARATOR.$driver->getName().DIRECTORY_SEPARATOR.$filename); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | if ($date === null) { |
| 53 | 53 | return $url; |
| 54 | 54 | } |
| 55 | - return $url . '?date=' . urlencode($date->format('d.m.Y')); |
|
| 55 | + return $url.'?date='.urlencode($date->format('d.m.Y')); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |