@@ -37,7 +37,7 @@ |
||
| 37 | 37 | private function makeCacheKey(): string |
| 38 | 38 | { |
| 39 | 39 | $key = $this->date === null ? '' : $this->date->format('.Y-m-d'); |
| 40 | - return str_replace('\\', '.', $this->driver) . $key; |
|
| 40 | + return str_replace('\\', '.', $this->driver).$key; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function build(CacheEntity $cacheEntity): DateTimeImmutable |
| 35 | 35 | { |
| 36 | - return $this->cache->load($cacheEntity->cacheKeyTtl, function ( |
|
| 36 | + return $this->cache->load($cacheEntity->cacheKeyTtl, function( |
|
| 37 | 37 | Dependency $dependency, |
| 38 | 38 | CacheInterface $cache, |
| 39 | 39 | string $prefix, |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | try { |
| 87 | 87 | $provider->initRequest($cacheEntity->date); |
| 88 | 88 | } catch (ClientExceptionInterface $e) { |
| 89 | - $data = $cache->get($prefix . $cacheEntity->cacheKeyAll) ?? []; |
|
| 89 | + $data = $cache->get($prefix.$cacheEntity->cacheKeyAll) ?? []; |
|
| 90 | 90 | |
| 91 | 91 | if ($cacheEntity->date === null && $data !== []) { |
| 92 | 92 | return [new DateTimeImmutable(), time() + $this->floatTtl]; |
@@ -96,11 +96,11 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | $all = []; |
| 98 | 98 | foreach ($provider->properties($this->allowedCurrencies) as $property) { |
| 99 | - $cache->set($prefix . $cacheEntity->keyCode($property->code), Serialize::encode($property)); |
|
| 99 | + $cache->set($prefix.$cacheEntity->keyCode($property->code), Serialize::encode($property)); |
|
| 100 | 100 | $all[$property->code] = true; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - $cache->set($prefix . $cacheEntity->cacheKeyAll, $all); |
|
| 103 | + $cache->set($prefix.$cacheEntity->cacheKeyAll, $all); |
|
| 104 | 104 | |
| 105 | 105 | return $cacheEntity->date === null |
| 106 | 106 | ? [$provider->getDate(), self::countTTL($provider->getRefresh())] |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | public function __construct(private CacheEntity $cacheEntity, private RatingListCache $ratingListCache) |
| 29 | 29 | { |
| 30 | 30 | $this->ratingListBuilder = new RatingListBuilder(); |
| 31 | - $this->ratingListBuilder->setDefault(function (string|int $key): Property { |
|
| 31 | + $this->ratingListBuilder->setDefault(function(string | int $key): Property { |
|
| 32 | 32 | $this->getDate(); // init cache |
| 33 | 33 | assert(is_string($key)); |
| 34 | 34 | return $this->ratingListCache->currency($this->cacheEntity, $key); |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | final class DriverBuilder extends LazyBuilder implements DriverAccessor |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | - public function get(string|int $key): Driver |
|
| 13 | + public function get(string | int $key): Driver |
|
| 14 | 14 | { |
| 15 | 15 | return parent::get($key); |
| 16 | 16 | } |
@@ -5,6 +5,6 @@ |
||
| 5 | 5 | interface DriverAccessor |
| 6 | 6 | { |
| 7 | 7 | |
| 8 | - function get(string|int $key): Driver; |
|
| 8 | + function get(string | int $key): Driver; |
|
| 9 | 9 | |
| 10 | 10 | } |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | private function createRequest(?\DateTimeInterface $date): RequestInterface |
| 112 | 112 | { |
| 113 | 113 | if ($date !== null && $date->getTimezone()->getName() !== $this->timeZone) { |
| 114 | - $date = new DateTime('@' . $date->getTimestamp(), new DateTimeZone('UTC')); |
|
| 114 | + $date = new DateTime('@'.$date->getTimestamp(), new DateTimeZone('UTC')); |
|
| 115 | 115 | $date->setTimezone(new DateTimeZone($this->timeZone)); |
| 116 | 116 | } |
| 117 | 117 | |
@@ -22,9 +22,9 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | public function __construct( |
| 25 | - string|Property $from, |
|
| 25 | + string | Property $from, |
|
| 26 | 26 | private RatingList\RatingListInterface $ratingList, |
| 27 | - string|Property|null $to = null, |
|
| 27 | + string | Property | null $to = null, |
|
| 28 | 28 | ) |
| 29 | 29 | { |
| 30 | 30 | $this->setFrom($from); |
@@ -159,13 +159,13 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
| 162 | - protected function setFrom(string|Property $from): void |
|
| 162 | + protected function setFrom(string | Property $from): void |
|
| 163 | 163 | { |
| 164 | 164 | $this->from = $from instanceof Property ? $from : $this->ratingList->get(strtoupper($from)); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | |
| 168 | - public function setTo(string|Property $to): void |
|
| 168 | + public function setTo(string | Property $to): void |
|
| 169 | 169 | { |
| 170 | 170 | $this->to = $to instanceof Property ? $to : $this->ratingList->get(strtoupper($to)); |
| 171 | 171 | } |