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

AbstractObjectStoreCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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