Passed
Pull Request — master (#91)
by Rustam
02:39
created

ResetCommand::__construct()   A

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\Debug\Command;
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\Debug\Storage\StorageInterface;
12
13
final class ResetCommand extends Command
14
{
15
    private StorageInterface $storage;
16
17
    protected static $defaultName = 'debug/reset';
18
19 1
    public function __construct(StorageInterface $storage)
20
    {
21 1
        $this->storage = $storage;
22 1
        parent::__construct();
23 1
    }
24
25 1
    protected function configure(): void
26
    {
27
        $this
28 1
            ->setDescription('Clear debug data')
29 1
            ->setHelp('This command clears debug storage data');
30 1
    }
31
32 1
    protected function execute(InputInterface $input, OutputInterface $output): int
33
    {
34 1
        $this->storage->clear();
35
36 1
        return ExitCode::OK;
37
    }
38
}
39