Clue\GraphComposer\Graph\GraphComposer::setFormat PHP Method

setFormat() public method

public setFormat ( $format )
    public function setFormat($format)
    {
        $this->graphviz->setFormat($format);
        return $this;
    }

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::setFormat