TheSeer\phpDox\Collector\IndexCollection::findUnitNodesBySrcFile PHP Method

findUnitNodesBySrcFile() public method

public findUnitNodesBySrcFile ( $path ) : DOMNodeList
$path
return DOMNodeList
    public function findUnitNodesBySrcFile($path)
    {
        $src = mb_substr($path, mb_strlen($this->srcDir) + 1);
        return $this->getRootElement()->query(sprintf('//*[@src="%s"]', $src));
    }

Usage Example

コード例 #1
0
ファイル: Project.php プロジェクト: rxz135cc/yii2webApp
 /**
  * @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);
     }
 }