ImageVersionsCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 2
1
<?php
2
3
namespace Stp\SndApi\News\Command;
4
5
use SoapBox\Formatter\Formatter;
6
use Stp\SndApi\Common\Command\BaseCommand;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10 View Code Duplication
class ImageVersionsCommand extends BaseCommand
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    use NewsClientCommandTrait;
13
14
    protected function configure()
15
    {
16
        parent::configure();
17
18
        $this
19
            ->setName('news:image:versions');
20
    }
21
22
    /**
23
     * @param InputInterface $input
24
     * @param OutputInterface $output
25
     * @return int
26
     */
27
    protected function execute(InputInterface $input, OutputInterface $output)
28
    {
29
        $newsClient = $this->getNewsClient($input);
30
31
        $result = $newsClient->getImageVersions();
32
        $formatter = Formatter::make($result, Formatter::ARR);
33
34
        $output->writeln($formatter->toYaml());
35
36
        return 0;
37
    }
38
}
39