SchemaClearCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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