Test Failed
Pull Request — 4.2 (#140)
by David
12:30
created

GenerateCommand   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 2
cbo 2
dl 0
loc 29
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A configure() 0 7 1
A execute() 0 7 1
1
<?php
2
namespace Mouf\Database\TDBM\Commands;
3
4
5
use Mouf\Database\TDBM\TDBMService;
6
use Symfony\Component\Console\Command\Command;
7
8
class GenerateCommand extends Command
9
{
10
11
    /**
12
     * @var TDBMService
13
     */
14
    private $tdbmService;
15
16
    public function __construct(TDBMService $tdbmService)
17
    {
18
        $this->tdbmService = $tdbmService;
19
    }
20
21
    protected function configure()
22
    {
23
        $this->setName('tdbm:generate')
24
            ->setDescription('Generates DAOs and beans.')
25
            ->setHelp('Use this command to generate or regenerate the DAOs and beans for your project.')
26
        ;
27
    }
28
29
    protected function execute(InputInterface $input, OutputInterface $output)
30
    {
31
        // TODO: wrap MultiLogger in configuration.
32
        // TODO: externalize composer.json file for autoloading (no more parameters for generateAllDaosAndBeans)
33
34
        $this->tdbmService->generateAllDaosAndBeans();
35
    }
36
}
37