Conditions | 3 |
Paths | 2 |
Total Lines | 23 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 3 | public function executeInner(SymfonyStyle $io, InputInterface $input): int |
|
26 | { |
||
27 | 3 | $key = $input->getArgument('key'); |
|
28 | 3 | $timestamp = $input->getOption('timestamp'); |
|
29 | 3 | $time = \DateTime::createFromFormat('U', (string) $timestamp) ?: new \DateTime(); |
|
30 | |||
31 | 3 | $entry = $this->objectStore->get($key, $time); |
|
32 | |||
33 | 3 | $io->title('Object store'); |
|
34 | |||
35 | 3 | if (!$entry) { |
|
36 | 2 | $io->error('Object not found!'); |
|
37 | |||
38 | 2 | return 1; |
|
39 | } |
||
40 | |||
41 | 2 | $io->horizontalTable(['Key', 'Value', 'Timestamp'], [[ |
|
42 | 2 | $entry->getKey(), |
|
43 | 2 | json_encode($entry->getValue()), |
|
44 | 2 | $time->getTimestamp(), |
|
45 | ]]); |
||
46 | |||
47 | 2 | return 0; |
|
48 | } |
||
50 |