original_string: public function getMetadata()
      {
          if ($this->metadata !== null) {
              /* We have already downloaded the metdata. */
              return $this->metadata;
          }
  
          if (!$this->aggregator->isCacheValid($this->cacheId, $this->cacheTag)) {
              $this->updateCache();
              /** @psalm-suppress TypeDoesNotContainType */
              if ($this->metadata !== null) {
                  return $this->metadata;
              }
              /* We were unable to update the cache - use cached metadata. */
          }
  
          $cacheFile = $this->aggregator->getCacheFile($this->cacheId);
  
          if (is_null($cacheFile) || !file_exists($cacheFile)) {
              Logger::error($this->logLoc . 'No cached metadata available.');
              return null;
          }
  
          Logger::debug($this->logLoc.'Using cached metadata from '.var_export($cacheFile, true));
  
          $metadata = file_get_contents($cacheFile);
          if ($metadata !== false) {
              $this->metadata = unserialize($metadata);
              return $this->metadata;
          }
  
          return null;
      }
code: public function getMetadata()
      {
          if ($this->metadata !== null) {
              /* We have already downloaded the metdata. */
              return $this->metadata;
          }
  
          if (!$this->aggregator->isCacheValid($this->cacheId, $this->cacheTag)) {
              $this->updateCache();
              /** @psalm-suppress TypeDoesNotContainType */
              if ($this->metadata !== null) {
                  return $this->metadata;
              }
              /* We were unable to update the cache - use cached metadata. */
          }
  
          $cacheFile = $this->aggregator->getCacheFile($this->cacheId);
  
          if (is_null($cacheFile) || !file_exists($cacheFile)) {
              Logger::error($this->logLoc . 'No cached metadata available.');
              return null;
          }
  
          Logger::debug($this->logLoc.'Using cached metadata from '.var_export($cacheFile, true));
  
          $metadata = file_get_contents($cacheFile);
          if ($metadata !== false) {
              $this->metadata = unserialize($metadata);
              return $this->metadata;
          }
  
          return null;
      }
code_tokens: public function getMetadata ( ) { if ( $ this -> metadata !== null ) { /* We have already downloaded the metdata. */ return $ this -> metadata ; } if ( ! $ this -> aggregator -> isCacheValid ( $ this -> cacheId , $ this -> cacheTag ) ) { $ this -> updateCache ( ) ; /** @psalm-suppress TypeDoesNotContainType */ if ( $ this -> metadata !== null ) { return $ this -> metadata ; } /* We were unable to update the cache - use cached metadata. */ } $ cacheFile = $ this -> aggregator -> getCacheFile ( $ this -> cacheId ) ; if ( is_null ( $ cacheFile ) || ! file_exists ( $ cacheFile ) ) { Logger :: error ( $ this -> logLoc . 'No cached metadata available.' ) ; return null ; } Logger :: debug ( $ this -> logLoc . 'Using cached metadata from ' . var_export ( $ cacheFile , true ) ) ; $ metadata = file_get_contents ( $ cacheFile ) ; if ( $ metadata !== false ) { $ this -> metadata = unserialize ( $ metadata ) ; return $ this -> metadata ; } return null ; }
docstring: Retrieve the metadata file.
  
  This function will check its cached copy, to see whether it can be used.
  
  @return \SAML2\XML\md\EntityDescriptor|\SAML2\XML\md\EntitiesDescriptor|null  The downloaded metadata.
docstring_tokens: Retrieve the metadata file .