SchemaClearCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A execute() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Cycle\Command\Schema;
6
7
use Symfony\Component\Console\Command\Command;
8
use Symfony\Component\Console\Input\InputInterface;
9
use Symfony\Component\Console\Output\OutputInterface;
10
use Yiisoft\Yii\Console\ExitCode;
11
use Yiisoft\Yii\Cycle\Command\CycleDependencyProxy;
12
13
final class SchemaClearCommand extends Command
14
{
15
    protected static $defaultName = 'cycle/schema/clear';
16
    protected static $defaultDescription = 'Clears the current schema cache';
17
18
    private CycleDependencyProxy $promise;
19
20 1
    public function __construct(CycleDependencyProxy $promise)
21
    {
22 1
        $this->promise = $promise;
23 1
        parent::__construct();
24
    }
25
26 1
    protected function execute(InputInterface $input, OutputInterface $output): int
27
    {
28 1
        $this->promise->getSchemaProvider()->clear();
29 1
        return ExitCode::OK;
30
    }
31
}
32