SyncMetadataCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 2
cbo 4
dl 0
loc 31
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 14 1
A execute() 0 10 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 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
        $this->io->success('Metadata storage synchronized');
37
38 1
        return 0;
39
    }
40
}
41