Skip to content

Commit

Permalink
fix: Stylecheck fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adambalint-srg committed Sep 28, 2023
1 parent afa61c8 commit f8c7ef1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Persistence/Mapping/AbstractClassMetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
use Traversable;

use function array_combine;
use function array_keys;
use function array_map;
use function array_reverse;
use function array_unshift;
use function assert;
use function class_exists;
use function iterator_to_array;
use function ltrim;
use function str_replace;
use function strpos;
Expand Down Expand Up @@ -206,14 +206,16 @@ public function getMetadataFor(string $className)
$this->wakeupReflection($cached, $this->getReflectionService());
} else {
$loadedMetadata = $this->loadMetadata($realClassName);
$cacheItems = $this->cache->getItems(array_map([$this, 'getCacheKey'], $loadedMetadata));
$cacheItems = $this->cache->getItems(array_map([$this, 'getCacheKey'], $loadedMetadata));

if ($cacheItems instanceof Traversable) {
$cacheItems = iterator_to_array($cacheItems);
}
$loadedMetadataItems = array_combine($loadedMetadata, $cacheItems);

foreach ($loadedMetadataItems as $loadedClassName => $item) {
$item->set($this->loadedMetadata[$loadedClassName]);
$loadedMetadataItems = array_combine($loadedMetadata, $cacheItems);

foreach ($loadedMetadataItems as $loadedClassName => $item) {
$item->set($this->loadedMetadata[$loadedClassName]);
$this->cache->saveDeferred($item);
}

Expand Down

0 comments on commit f8c7ef1

Please sign in to comment.