Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
7 / 7
LiskovCommand
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
7 / 7
 getSubname()
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getFullDesc()
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 processGraph(Graph $graph, OutputInterface $output)
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
5 / 5
<?php
/*
 * Mondrian
 */
namespace Trismegiste\Mondrian\Command;
use Symfony\Component\Console\Output\OutputInterface;
use Trismegiste\Mondrian\Graph\Graph;
use Trismegiste\Mondrian\Analysis\LiskovSearch;
/**
 * LiskovCommand transforms a bunch of php files into a reduced digraph
 * to the LSP violation to refactor (mandatory before ISP)
 *
 */
class LiskovCommand extends AbstractParse
{
    protected function getSubname()
    {
        return 'liskov';
    }
    protected function getFullDesc()
    {
        return parent::getFullDesc() . ' with LSP violation';
    }
    protected function processGraph(Graph $graph, OutputInterface $output)
    {
        $algo = new LiskovSearch($graph);
        $result = $algo->createReducedGraph();
        $central = new \Trismegiste\Mondrian\Analysis\UsedCentrality($result);
        $central->decorate();
        return $result;
    }
}