setTokenFileReference() public method

public setTokenFileReference ( TheSeer\phpDox\Collector\SourceFile $file, $tokenPath )
$file TheSeer\phpDox\Collector\SourceFile
Example #1
0
 private function saveSources()
 {
     foreach ($this->files as $file) {
         $tokenDom = $file->getTokens();
         $tokenDom->formatOutput = TRUE;
         $tokenDom->preserveWhiteSpace = FALSE;
         $relName = 'tokens/' . $file->getRelative($this->srcDir, FALSE) . '.xml';
         $fname = $this->xmlDir . '/' . $relName;
         $dir = dirname($fname);
         if (!file_exists($dir)) {
             mkdir($dir, 0777, true);
         }
         try {
             $tokenDom->save($fname);
         } catch (fDOMException $e) {
             throw new ProjectException(sprintf("Internal Error: Token xml file '%s' could not be saved.", $fname), ProjectException::UnitCouldNotBeSaved, $e);
         }
         $this->source->setTokenFileReference($file, $relName);
     }
     $sourceDom = $this->source->export();
     $sourceDom->formatOutput = TRUE;
     $sourceDom->preserveWhiteSpace = FALSE;
     $sourceDom->save($this->xmlDir . '/source.xml');
 }