Clue\GraphComposer\Graph\GraphComposer::getImagePath PHP Method

getImagePath() public method

public getImagePath ( )
    public function getImagePath()
    {
        $graph = $this->createGraph();
        return $this->graphviz->createImageFile($graph);
    }

Usage Example

Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $graph = new GraphComposer($input->getArgument('dir'));
     $target = $input->getArgument('output');
     if ($target !== null) {
         if (is_dir($target)) {
             $target = rtrim($target, '/') . '/graph-composer.svg';
         }
         $filename = basename($target);
         $pos = strrpos($filename, '.');
         if ($pos !== false && isset($filename[$pos + 1])) {
             // extension found and not empty
             $graph->setFormat(substr($filename, $pos + 1));
         }
     }
     $format = $input->getOption('format');
     if ($format !== null) {
         $graph->setFormat($format);
     }
     $path = $graph->getImagePath();
     if ($target !== null) {
         rename($path, $target);
     } else {
         readfile($path);
     }
 }
All Usage Examples Of Clue\GraphComposer\Graph\GraphComposer::getImagePath