Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
8 / 8 |
ContractorCommand | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
8 / 8 |
configure() | |
100.00% |
1 / 1 |
1 | |
100.00% |
4 / 4 |
|||
execute(InputInterface $input, OutputInterface $output) | |
100.00% |
1 / 1 |
1 | |
100.00% |
4 / 4 |
<?php | |
/* | |
* Mondrian | |
*/ | |
namespace Trismegiste\Mondrian\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Trismegiste\Mondrian\Parser\PhpDumper; | |
use Trismegiste\Mondrian\Builder\Linking; | |
use Trismegiste\Mondrian\Builder\Statement\Builder; | |
use Trismegiste\Mondrian\Refactor\ContractorBuilder; | |
/** | |
* ContractorCommand recursively scans a directory and | |
* refactors concrete class with annotations. | |
* | |
* It creates an interface, changes paramters types and adds inheritance | |
*/ | |
class ContractorCommand extends RefactorCommand | |
{ | |
protected function configure() | |
{ | |
parent::configure(); | |
$this->setName('refactor:abstract') | |
->setDescription('Scans a directory and refactors classes with annotations'); | |
} | |
protected function execute(InputInterface $input, OutputInterface $output) | |
{ | |
$compil = new Linking( | |
new Builder(), new ContractorBuilder(new PhpDumper())); | |
$compil->run($this->phpfinder->getIterator()); | |
} | |
} |