/** * @param string $path */ private function removeFileReferences($path) { foreach($this->index->findUnitNodesBySrcFile($path) as $node) { /** @var $node \DOMElement */ $fname = $this->xmlDir . '/' . $node->getAttribute('xml'); if (file_exists($fname)) { unlink($fname); } $node->parentNode->removeChild($node); } }