TheSeer\phpDox\Collector\Project::saveSources PHP Method

saveSources() private method

private saveSources ( )
    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');
    }