Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function addFile(StreamBase $tokenStream, ReflectionFile $file)
 {
     if (self::$level <= 1) {
         // Clean the old cache only for main classes, allow to bypass cleaning for hierarchy
         $this->clearTokenCache();
     }
     return parent::addFile($tokenStream, $file);
 }
Ejemplo n.º 2
0
 /**
  * Adds a file to the backend storage.
  *
  * @param \TokenReflection\Stream\StreamBase $tokenStream Token stream
  * @param \TokenReflection\ReflectionFile $file File reflection object
  * @return \TokenReflection\Broker\Backend\Memory
  */
 public function addFile(TokenReflection\Stream\StreamBase $tokenStream, TokenReflection\ReflectionFile $file)
 {
     if ($this->cacheTokenStreams) {
         $this->fileCache[$file->getName()] = $cacheFile = tempnam(sys_get_temp_dir(), 'trc');
         file_put_contents($cacheFile, serialize($tokenStream));
     }
     parent::addFile($tokenStream, $file);
     return $this;
 }