private function getFromCache(string $class): ?ClassMetadataInterface
    {
        if (null === $this->cache) {
            return null;
        }

        if ($this->cache instanceof Cache) {
            $cached = $this->cache->fetch($class) ?: null;
        } else {
            $class = preg_replace('#[\{\}\(\)/\\\\@:]#', '_', str_replace('_', '__', $class));
            $item = $this->cache->getItem($class);
            $cached = $item->isHit() ? $item->get() : null;
        }

        return $cached;
    }
private function getFromCache(string $class): ?ClassMetadataInterface
    {
        if (null === $this->cache) {
            return null;
        }

        if ($this->cache instanceof Cache) {
            $cached = $this->cache->fetch($class) ?: null;
        } else {
            $class = preg_replace('#[\{\}\(\)/\\\\@:]#', '_', str_replace('_', '__', $class));
            $item = $this->cache->getItem($class);
            $cached = $item->isHit() ? $item->get() : null;
        }

        return $cached;
    }
private function getFromCache ( string $ class ) : ? ClassMetadataInterface { if ( null === $ this -> cache ) { return null ; } if ( $ this -> cache instanceof Cache ) { $ cached = $ this -> cache -> fetch ( $ class ) ? : null ; } else { $ class = preg_replace ( '#[\{\}\(\)/\\\\@:]#' , '_' , str_replace ( '_' , '__' , $ class ) ) ; $ item = $ this -> cache -> getItem ( $ class ) ; $ cached = $ item -> isHit ( ) ? $ item -> get ( ) : null ; } return $ cached ; }
Check a cache pool for cached metadata.

@param string $class

@return null|ClassMetadataInterface
Check a cache pool for cached metadata .