Test Setup Failed
Push — master ( eaec61...fed08a )
by Ion
02:23
created

AbstractObjectStoreCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 7 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Interfaces\Console;
6
7
use App\Domain\Service\ObjectStoreInterface;
8
use Symfony\Component\Console\Command\Command;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
use Symfony\Component\Console\Style\SymfonyStyle;
12
13
abstract class AbstractObjectStoreCommand extends Command
14
{
15
    protected ObjectStoreInterface $objectStore;
16
17 4
    public function __construct(ObjectStoreInterface $objectStore)
18
    {
19 4
        $this->objectStore = $objectStore;
20
21 4
        parent::__construct();
22 4
    }
23
24 1
    protected function execute(InputInterface $input, OutputInterface $output): int
25
    {
26 1
        $io = new SymfonyStyle($input, $output);
27 1
        $result = $this->executeInner($io, $input);
28 1
        $io->comment('Current timestamp: '.time());
29
30 1
        return $result;
31
    }
32
33
    abstract public function executeInner(SymfonyStyle $io, InputInterface $input): int;
34
}
35