Failed Conditions
Pull Request — master (#968)
by Edi
02:04
created

SyncMetadataCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 14
c 1
b 0
f 1
dl 0
loc 29
ccs 0
cts 11
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 8 1
A execute() 0 9 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
final class SyncMetadataCommand extends DoctrineCommand
11
{
12
    /** @var string */
13
    protected static $defaultName = 'migrations:sync-metadata-storage';
14
15
    protected function configure() : void
16
    {
17
        parent::configure();
18
19
        $this
20
            ->setAliases(['sync-metadata-storage'])
21
            ->setDescription('Ensures that the metadata storage is at the latest version.')
22
            ->setHelp(<<<EOT
23
The <info>%command.name%</info> command updates metadata storage the latest version.
24
25
    <info>%command.full_name%</info>
26
EOT
27
            );
28
    }
29
30
    public function execute(
31
        InputInterface $input,
32
        OutputInterface $output
33
    ) : int {
34
        $this->getDependencyFactory()->getMetadataStorage()->ensureInitialized();
35
36
        $this->io->success('Metadata storage synchronized');
37
38
        return 0;
39
    }
40
}
41