Completed
Pull Request — master (#1)
by Grebenikov
14:36
created

MinuboConsole   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 4 1
A execute() 0 7 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Zed\Minubo\Communication\Console;
9
10
use Spryker\Zed\Kernel\Communication\Console\Console;
11
use Symfony\Component\Console\Input\InputInterface;
12
use Symfony\Component\Console\Output\OutputInterface;
13
14
/**
15
 * @method \SprykerEco\Zed\Minubo\Business\MinuboFacadeInterface getFacade()
16
 */
17
class MinuboConsole extends Console
18
{
19
    const COMMAND_NAME = 'minubo:export:data';
20
    const DESCRIPTION = 'Run export of data to Minubo';
21
22
    /**
23
     * @return void
24
     */
25
    protected function configure(): void
26
    {
27
        $this->setName(static::COMMAND_NAME)
28
            ->setDescription(static::DESCRIPTION);
29
    }
30
31
    /**
32
     * @param \Symfony\Component\Console\Input\InputInterface $input
33
     * @param \Symfony\Component\Console\Output\OutputInterface $output
34
     *
35
     * @return int|null
36
     */
37
    protected function execute(InputInterface $input, OutputInterface $output): ?int
38
    {
39
40
        $this->getFacade()
41
            ->exportData();
42
43
        return static::CODE_SUCCESS;
44
    }
45
}
46