|
@@ -81,7 +81,7 @@ discard block |
|
|
block discarded – undo |
|
81
|
81
|
{ |
|
82
|
82
|
$listRates = $driver->download($date, $this->allowedCurrencies); |
|
83
|
83
|
|
|
84
|
|
- file_put_contents(Utils\SafeStream::PROTOCOL . '://' . $file->getPathname(), serialize($listRates)); |
|
|
84
|
+ file_put_contents(Utils\SafeStream::PROTOCOL.'://'.$file->getPathname(), serialize($listRates)); |
|
85
|
85
|
if (self::isFileCurrent($file)) { |
|
86
|
86
|
touch($file->getPathname(), $this->getRefresh()); |
|
87
|
87
|
} |
|
@@ -93,7 +93,7 @@ discard block |
|
|
block discarded – undo |
|
93
|
93
|
{ |
|
94
|
94
|
if ($this->isFileValid($file)) { |
|
95
|
95
|
Utils\FileSystem::createDir($file->getPath(), 0755); |
|
96
|
|
- $handle = fopen(Utils\SafeStream::PROTOCOL . '://' . $this->temp . DIRECTORY_SEPARATOR . 'lock', 'w'); |
|
|
96
|
+ $handle = fopen(Utils\SafeStream::PROTOCOL.'://'.$this->temp.DIRECTORY_SEPARATOR.'lock', 'w'); |
|
97
|
97
|
|
|
98
|
98
|
if ($this->isFileValid($file)) { |
|
99
|
99
|
$listRate = $this->saveCurrencies($driver, $file, $date); |
|
@@ -119,7 +119,7 @@ discard block |
|
|
block discarded – undo |
|
119
|
119
|
private function getRefresh() |
|
120
|
120
|
{ |
|
121
|
121
|
if (!is_int($this->refresh)) { |
|
122
|
|
- $this->refresh = (int) (new \DateTime('today ' . $this->refresh))->format('U'); |
|
|
122
|
+ $this->refresh = (int) (new \DateTime('today '.$this->refresh))->format('U'); |
|
123
|
123
|
if (time() >= $this->refresh) { |
|
124
|
124
|
$this->refresh += Utils\DateTime::DAY; |
|
125
|
125
|
} |
|
@@ -130,7 +130,7 @@ discard block |
|
|
block discarded – undo |
|
130
|
130
|
private function createFileInfo(Driver\ADriver $driver, \DateTime $date = NULL) |
|
131
|
131
|
{ |
|
132
|
132
|
$filename = $date === NULL ? self::FILE_CURRENT : $date->format('Y-m-d'); |
|
133
|
|
- return new \SplFileInfo($this->temp . DIRECTORY_SEPARATOR . $driver->getName() . DIRECTORY_SEPARATOR . $filename); |
|
|
133
|
+ return new \SplFileInfo($this->temp.DIRECTORY_SEPARATOR.$driver->getName().DIRECTORY_SEPARATOR.$filename); |
|
134
|
134
|
} |
|
135
|
135
|
|
|
136
|
136
|
private static function isFileCurrent(\SplFileInfo $file) |