Passed
Pull Request — master (#878)
by Asmir
02:42
created

SyncMetadataCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 1
rs 9.9666
c 1
b 0
f 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Migrations\Tools\Console\Command;
6
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class SyncMetadataCommand extends DoctrineCommand
11
{
12
    /** @var string */
13
    protected static $defaultName = 'migrations:sync-metadata-storage';
14
15 1
    protected function configure() : void
16
    {
17 1
        parent::configure();
18
19
        $this
20 1
            ->setAliases(['sync-metadata-storage'])
21 1
            ->setDescription('Ensures that the metadata storage is at the latest version.')
22 1
            ->setHelp(<<<EOT
23 1
The <info>%command.name%</info> command updates metadata storage the latest version.
24
25
    <info>%command.full_name%</info>
26
EOT
27
            );
28 1
    }
29
30 1
    public function execute(
31
        InputInterface $input,
32
        OutputInterface $output
33
    ) : int {
34 1
        $this->getDependencyFactory()->getMetadataStorage()->ensureInitialized();
35
36 1
        $output->writeln('Metadata storage synchronized');
37
38 1
        return 0;
39
    }
40
}
41