Example #1
0
 /**
  * Returns the dependencies between the classes of this project
  * as GraphViz/DOT markup.
  *
  * @return Image_GraphViz
  * @since Method available since Release 3.2.2
  */
 public function getDependenciesAsDOT()
 {
     if (PHPCoverage_Util_Filesystem::fileExistsInIncludePath('Image/GraphViz.php')) {
         require_once 'Image/GraphViz.php';
     } else {
         throw new RuntimeException('Image_GraphViz is not available.');
     }
     $graph = new Image_GraphViz(TRUE, array('overlap' => 'scale', 'splines' => 'true', 'sep' => '.1', 'fontsize' => '8'));
     foreach (array_keys($this->dependencies) as $className) {
         $graph->addNode($className);
     }
     foreach ($this->dependencies as $from => $dependencies) {
         foreach ($dependencies as $to => $flag) {
             if ($flag === 1) {
                 $graph->addEdge(array($from => $to));
             }
         }
     }
     return $graph;
 }