FactFinderNgImportSearchConsole   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
c 2
b 0
f 0
dl 0
loc 27
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 5 2
A configure() 0 6 1
1
<?php
2
3
/**
4
 * MIT License
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
namespace SprykerEco\Zed\FactFinderNg\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\FactFinderNg\Communication\FactFinderNgCommunicationFactory getFactory()
16
 */
17
class FactFinderNgImportSearchConsole extends Console
18
{
19
    public const COMMAND_NAME = 'fact-finder-ng:import:search';
20
    public const DESCRIPTION = 'Trigger importing of search data. Url for file is defined on FF side.';
21
22
    /**
23
     * @return void
24
     */
25
    protected function configure()
26
    {
27
        $this->setName(static::COMMAND_NAME);
28
        $this->setDescription(static::DESCRIPTION);
29
30
        parent::configure();
31
    }
32
33
    /**
34
     * @param \Symfony\Component\Console\Input\InputInterface $input
35
     * @param \Symfony\Component\Console\Output\OutputInterface $output
36
     *
37
     * @return int
38
     */
39
    protected function execute(InputInterface $input, OutputInterface $output)
40
    {
41
        $responseTransfer = $this->getFactory()->getFactFinderNgClient()->triggerSearchImport();
42
43
        return $responseTransfer->getIsSuccess() ? static::CODE_SUCCESS : static::CODE_ERROR;
44
    }
45
}
46