ShowTask   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 44.44%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 26
ccs 4
cts 9
cp 0.4444
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 7 1
A configure() 0 6 1
1
<?php
2
3
namespace JobQueue\Application\Console;
4
5
use JobQueue\Application\Utils\CommandTrait;
6
use Symfony\Component\Console\Input\InputArgument;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
final class ShowTask extends ManagerCommand
11
{
12
    use CommandTrait;
13
14
    public function configure()
15
    {
16
        $this
17
            ->setName('show')
18
            ->setDescription('Show a task information')
19
            ->addArgument('identifier', InputArgument::REQUIRED, 'Task UUID identifier')
20
        ;
21
    }
22
23
    /**
24
     *
25
     * @param InputInterface $input
26
     * @param OutputInterface $output
27
     * @return int
28
     */
29 1
    protected function execute(InputInterface $input, OutputInterface $output): int
30
    {
31 1
        $task = $this->queue->find($input->getArgument('identifier'));
32
33 1
        $this->formatTaskBlock($task, $output);
34
35 1
        return 0;
36
    }
37
}
38