BuildCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 22
rs 10
ccs 7
cts 7
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 6 1
A execute() 0 4 1
1
<?php
2
3
namespace SilverLeague\Console\Command\Dev;
4
5
use SilverLeague\Console\Command\SilverStripeCommand;
6
use SilverStripe\ORM\DatabaseAdmin;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
/**
11
 * The BuildCommand will trigger SilverStripe's database rebuild operation
12
 *
13
 * @package silverstripe-console
14
 * @author  Robbie Averill <[email protected]>
15
 */
16
class BuildCommand extends SilverStripeCommand
17
{
18
    /**
19
     * {@inheritDoc}
20
     */
21 3
    protected function configure()
22
    {
23
        $this
24 3
            ->setName('dev:build')
25 3
            ->setDescription('Builds the SilverStripe database');
26 3
    }
27
28
    /**
29
     * {@inheritDoc}
30
     * @param InputInterface $input
31
     * @param OutputInterface $output
32
     */
33 1
    protected function execute(InputInterface $input, OutputInterface $output)
34
    {
35 1
        (new DatabaseAdmin)->build();
36 1
    }
37
}
38