public function setTokenFileReference(SourceFile $file, $tokenPath) { $path = $file->getRealPath(); if (!isset($this->collection[$path])) { throw new SourceCollectionException(sprintf("File %s not found in collection", $path), SourceCollectionException::SourceNotFound); } $this->collection[$path]->setAttribute('xml', $tokenPath); }