public function addFile(SourceFile $file)
{
$path = $file->getRealPath();
$node = $this->workDom->createElementNS('http://xml.phpdox.net/src', 'file');
$node->setAttribute('name', basename($file->getBasename()));
$node->setAttribute('size', $file->getSize());
$node->setAttribute('time', date('c', $file->getMTime()));
$node->setAttribute('unixtime', $file->getMTime());
$node->setAttribute('sha1', sha1_file($file->getPathname()));
$this->collection[$path] = $node;
$changed = $this->isChanged($path);
if (!$changed) {
$node->setAttribute('xml', $this->original[$path]->getAttribute('xml'));
}
return $changed;
}