Ejemplo n.º 1
0
 /**
  * @param array $dependencyTree
  *
  * @return string
  */
 public function build(array $dependencyTree)
 {
     foreach ($dependencyTree as $dependency) {
         $this->graph->addNode($dependency[DependencyTree::META_BUNDLE], $this->getNodeAttributes($dependency));
         $this->graph->addNode($dependency[DependencyTree::META_FOREIGN_BUNDLE], $this->getForeignNodeAttributes($dependency));
     }
     foreach ($dependencyTree as $dependency) {
         $this->graph->addEdge($dependency[DependencyTree::META_BUNDLE], $dependency[DependencyTree::META_FOREIGN_BUNDLE], $this->getEdgeAttributes($dependency));
     }
     return $this->graph->render('svg');
 }
Ejemplo n.º 2
0
 /**
  * @param array $dependencyTree
  *
  * @return string
  */
 public function build(array $dependencyTree)
 {
     foreach ($dependencyTree as $dependency) {
         $this->graph->addNode($dependency[DependencyTree::META_BUNDLE], $this->getFromAttributes($dependency));
         if (!empty($dependency[DependencyTree::META_COMPOSER_NAME])) {
             $this->graph->addNode($dependency[DependencyTree::META_COMPOSER_NAME], $this->getToAttributes($dependency));
         }
     }
     foreach ($dependencyTree as $dependency) {
         if (empty($dependency[DependencyTree::META_COMPOSER_NAME])) {
             continue;
         }
         $this->graph->addEdge($dependency[DependencyTree::META_BUNDLE], $dependency[DependencyTree::META_COMPOSER_NAME], $this->getEdgeAttributes($dependency));
     }
     return $this->graph->render('svg');
 }
Ejemplo n.º 3
0
 /**
  * @param \Orm\Zed\Category\Persistence\SpyCategoryNode $node
  *
  * @return void
  */
 protected function addClosureConnections(SpyCategoryNode $node)
 {
     $descendantPaths = $this->queryContainer->queryDescendant($node->getPrimaryKey())->find();
     foreach ($descendantPaths as $path) {
         $attributes = ['color' => '#ff0000'];
         $this->graph->addEdge($this->getNodeHash($node), $this->getNodeHash($path->getDescendantNode()), $attributes);
     }
 }
Ejemplo n.º 4
0
 /**
  * @param array $dependencyInformation
  * @param string $group
  *
  * @return void
  */
 private function addForeignBundleLayer(array $dependencyInformation, $group)
 {
     $foreignBundleLayerNodeId = $this->getForeignBundleLayerNodeId($dependencyInformation);
     $label = $dependencyInformation[DependencyTree::META_FOREIGN_BUNDLE] . ' ' . $dependencyInformation[DependencyTree::META_FOREIGN_LAYER];
     $attributes = $this->layerAttributes;
     $attributes['label'] = $label;
     $this->graph->addNode($foreignBundleLayerNodeId, $attributes, $group);
     $this->graph->addEdge($this->getRootFileNodeId($dependencyInformation), $foreignBundleLayerNodeId, ['label' => $this->getForeignUsage($dependencyInformation[DependencyTree::META_FINDER]) . ' : ' . $dependencyInformation[DependencyTree::META_FOREIGN_CLASS_NAME], 'fontsize' => 8]);
 }
Ejemplo n.º 5
0
 /**
  * @param \Spryker\Zed\Oms\Business\Process\TransitionInterface $transition
  * @param string $type
  * @param array $attributes
  * @param string|null $fromName
  * @param string|null $toName
  *
  * @return void
  */
 protected function addEdge(TransitionInterface $transition, $type = self::EDGE_FULL, $attributes = [], $fromName = null, $toName = null)
 {
     $label = [];
     if ($type !== self::EDGE_LOWER_HALF) {
         $label = $this->addEdgeEventText($transition, $label);
     }
     if ($type !== self::EDGE_UPPER_HALF) {
         $label = $this->addEdgeConditionText($transition, $label);
     }
     $label = $this->addEdgeElse($label);
     $fromName = $this->addEdgeFromState($transition, $fromName);
     $toName = $this->addEdgeToState($transition, $toName);
     $attributes = $this->addEdgeAttributes($transition, $attributes, $label, $type);
     $this->graph->addEdge($fromName, $toName, $attributes);
 }