private function saveInCache(string $class, ClassMetadataInterface $classMetadata): void
    {
        if (null === $this->cache) {
            return;
        }

        if ($this->cache instanceof Cache) {
            $this->cache->save($class, $classMetadata);
        } else {
            $class = preg_replace('#[\{\}\(\)/\\\\@:]#', '_', str_replace('_', '__', $class));
            $item = $this->cache->getItem($class);
            $item->set($classMetadata);

            $this->cache->save($item);
        }
    }
private function saveInCache(string $class, ClassMetadataInterface $classMetadata): void
    {
        if (null === $this->cache) {
            return;
        }

        if ($this->cache instanceof Cache) {
            $this->cache->save($class, $classMetadata);
        } else {
            $class = preg_replace('#[\{\}\(\)/\\\\@:]#', '_', str_replace('_', '__', $class));
            $item = $this->cache->getItem($class);
            $item->set($classMetadata);

            $this->cache->save($item);
        }
    }
private function saveInCache ( string $ class , ClassMetadataInterface $ classMetadata ) : void { if ( null === $ this -> cache ) { return ; } if ( $ this -> cache instanceof Cache ) { $ this -> cache -> save ( $ class , $ classMetadata ) ; } else { $ class = preg_replace ( '#[\{\}\(\)/\\\\@:]#' , '_' , str_replace ( '_' , '__' , $ class ) ) ; $ item = $ this -> cache -> getItem ( $ class ) ; $ item -> set ( $ classMetadata ) ; $ this -> cache -> save ( $ item ) ; } }
Saves a metadata into a cache pool.

@param string                 $class
@param ClassMetadataInterface $classMetadata
Saves a metadata into a cache pool .