Trismegiste\Mondrian\Analysis\SpaghettiCoupling::generateCoupledClassGraph PHP Метод

generateCoupledClassGraph() публичный Метод

Generate a digraph reduced to all concrete coupled classes
    public function generateCoupledClassGraph()
    {
        if (is_null($this->strategy)) {
            throw new \LogicException('No defined strategy');
        }
        $vSet = $this->graph->getVertexSet();
        foreach ($vSet as $src) {
            if ($src instanceof ClassVertex) {
                foreach ($vSet as $dst) {
                    if ($dst instanceof ClassVertex && $dst !== $src) {
                        $this->resetVisited();
                        $path = $this->searchPath($src, $dst);
                        $this->strategy->collapseEdge($src, $dst, $path);
                    }
                }
            }
        }
    }

Usage Example

Пример #1
0
 protected function processGraph(Graph $graph, OutputInterface $output)
 {
     $algo = new SpaghettiCoupling($graph);
     $result = new Digraph();
     $chosenStrategy = $this->connectionStrategy;
     $algo->setFilterPath(new $chosenStrategy($result));
     $algo->generateCoupledClassGraph();
     if ($this->showCycle) {
         $result = new Cycle($result);
     }
     return $result;
 }
All Usage Examples Of Trismegiste\Mondrian\Analysis\SpaghettiCoupling::generateCoupledClassGraph