FactFinderSdkExportConsole   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 12
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 6 1
A execute() 0 9 2
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\FactFinderSdk\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\FactFinderSdk\Communication\FactFinderSdkCommunicationFactory getFactory()
16
 * @method \SprykerEco\Zed\FactFinderSdk\Business\FactFinderSdkFacadeInterface getFacade()
17
 * @method \SprykerEco\Zed\FactFinderSdk\Persistence\FactFinderSdkQueryContainerInterface getQueryContainer()
18
 */
19
class FactFinderSdkExportConsole extends Console
20
{
21
    public const COMMAND_NAME = 'fact-finder:export:products';
22
    public const COMMAND_DESCRIPTION = 'Export product data for Fact Finder';
23
24
    /**
25
     * @return void
26
     */
27
    protected function configure()
28
    {
29
        $this->setName(static::COMMAND_NAME);
30
        $this->setDescription(static::COMMAND_DESCRIPTION);
31
32
        parent::configure();
33
    }
34
35
    /**
36
     * @param \Symfony\Component\Console\Input\InputInterface $input
37
     * @param \Symfony\Component\Console\Output\OutputInterface $output
38
     *
39
     * @return int|null|void
40
     */
41
    protected function execute(InputInterface $input, OutputInterface $output)
42
    {
43
        $localeTransfers = $this->getFactory()
44
            ->getLocaleFacade()
45
            ->getLocaleCollection();
46
47
        foreach ($localeTransfers as $localeTransfer) {
48
            $this->getFacade()
49
                ->createFactFinderSdkCsv($localeTransfer);
50
        }
51
    }
52
}
53