original_string: public function getClassMetadata($class)
      {
          $class = ltrim($class, '\\');
          $metadataIndex = $this->getCacheId($class);
  
          if (isset($this->loadedMetadata[$metadataIndex])) {
              return $this->loadedMetadata[$metadataIndex];
          }
  
          if (isset($this->cache)) {
              if (false !== ($metadata = $this->cache->fetch($metadataIndex))) {
                  return $metadata;
              }
          }
  
          $metadata = new $this->metadataClassName($class);
  
          $parentClasses = array_reverse(class_parents($class));
          foreach ($parentClasses as $parentClass) {
              $metadata->setClassName($parentClass);
              $this->driver->loadClassMetadata($metadata);
          }
  
          $metadata->setClassName($class);
          $this->driver->loadClassMetadata($metadata);
  
          if (isset($this->cache)) {
              $this->cache->save($metadataIndex, $metadata);
          }
          $this->loadedMetadata[$metadataIndex] = $metadata;
  
          return $metadata;
      }
code: public function getClassMetadata($class)
      {
          $class = ltrim($class, '\\');
          $metadataIndex = $this->getCacheId($class);
  
          if (isset($this->loadedMetadata[$metadataIndex])) {
              return $this->loadedMetadata[$metadataIndex];
          }
  
          if (isset($this->cache)) {
              if (false !== ($metadata = $this->cache->fetch($metadataIndex))) {
                  return $metadata;
              }
          }
  
          $metadata = new $this->metadataClassName($class);
  
          $parentClasses = array_reverse(class_parents($class));
          foreach ($parentClasses as $parentClass) {
              $metadata->setClassName($parentClass);
              $this->driver->loadClassMetadata($metadata);
          }
  
          $metadata->setClassName($class);
          $this->driver->loadClassMetadata($metadata);
  
          if (isset($this->cache)) {
              $this->cache->save($metadataIndex, $metadata);
          }
          $this->loadedMetadata[$metadataIndex] = $metadata;
  
          return $metadata;
      }
code_tokens: public function getClassMetadata ( $ class ) { $ class = ltrim ( $ class , '\\' ) ; $ metadataIndex = $ this -> getCacheId ( $ class ) ; if ( isset ( $ this -> loadedMetadata [ $ metadataIndex ] ) ) { return $ this -> loadedMetadata [ $ metadataIndex ] ; } if ( isset ( $ this -> cache ) ) { if ( false !== ( $ metadata = $ this -> cache -> fetch ( $ metadataIndex ) ) ) { return $ metadata ; } } $ metadata = new $ this -> metadataClassName ( $ class ) ; $ parentClasses = array_reverse ( class_parents ( $ class ) ) ; foreach ( $ parentClasses as $ parentClass ) { $ metadata -> setClassName ( $ parentClass ) ; $ this -> driver -> loadClassMetadata ( $ metadata ) ; } $ metadata -> setClassName ( $ class ) ; $ this -> driver -> loadClassMetadata ( $ metadata ) ; if ( isset ( $ this -> cache ) ) { $ this -> cache -> save ( $ metadataIndex , $ metadata ) ; } $ this -> loadedMetadata [ $ metadataIndex ] = $ metadata ; return $ metadata ; }
docstring: Returns class metadata read by the driver. This method calls itself recursively for each ancestor class
  
  @param string $class
  @return \FSi\Component\Metadata\ClassMetadataInterface
docstring_tokens: Returns class metadata read by the driver . This method calls itself recursively for each ancestor class